2. (10 pts) Let L = {w € {a,b}\whas the same number of a's and b's). Consider the fol- lowing algorithm that decides L.
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
2. (10 pts) Let L = {w € {a,b}\whas the same number of a's and b's). Consider the fol- lowing algorithm that decides L.
2. (10 pts) Let L = {w € {a,b}\whas the same number of a's and b's). Consider the fol- lowing algorithm that decides L. 1/ = "In input w: 1. Scan across the tape until a a or b is found. 2. If none is found, accept. 3. If one is found, continue scanning until a matching b or a is found. b 4. If none is found, reject. 5. Otherwise, cross off that symbol and repeat." Using the Big-O notation, state the time complexity of each step of M, and the overall tir complexity of M.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!