Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

QU The Theory of Computer Science Questions

QU The Theory of Computer Science Questions

QU The Theory of Computer Science Questions

Description

Unformatted Attachment Preview

1. [5 marks] Give the big-Oh for the following functions:
(a) f (n) = 13n3 + 42n4 + 100n + 105
n
(b) f (n) = 1000n + 10n2 log (n) + log2 (n)
3
2
log (100n)
(c) f (n) = 100n
+ 100n
2n +
n3
2
(d) f (n) = 32n log (n) + 23n2 log (n)
n
2
n
(e) f (n) = 8 log2(n)2 + 16 2n2 + 32 2nn
2. Consider the following algorithm on a single-tape deterministic Turing machine that decides
the language L = {? ? {0, 1}? : ? = ? r }. I.e., all words that are palindromes
Main Loop: Sweep back and forth, comparing the end-points of the string and
removing them each round.
(1) Read the symbol, store value in state, write #, and move right.
(2) Sweep right until a # is encountered.
f there were no 0àor 1ì accept.
lse, move left one cell.
(3) Read the symbol to the left of the #.
f the symbol is not the same as the one read in Step (1), reject.
lse, write a # and move left.
(4) Read the symbol, store value in state, write #, and move left.
(5) Sweep left until a # is encountered.
f there were no 0àor 1ì accept.
lse, move right one cell.
(6) Read the symbol to the right of the #.
f the symbol is not the same as the one read in Step (4), reject.
lse, write a # and move rightŠ(a) [5 marks] Give the space complexity of this algorithm in big-Oh. Explain your answer.
(b) [5 marks] Give the time complexity of this algorithm in big-Oh. Explain your answer.
1
3. Consider the following algorithm on a RAM that decides language L = {? ? {0, 1}? : ? = ? r }.
nitialize r0 to 10 and r1 to 9
oop: Load the palindrome into the RAM into r10, r11, … r10 + n
ead symbol from input tape into r2
f r2 contains # break
ncrement r1

ove r2 into [r1]
oop: Verify palindrome
f r0 ? r1, accept
f [r0] 6= [r1], reject
ncrement r0
ecrement r1
(a) [5 marks] Give the space complexity of this algorithm in big-Oh. Explain your answer.
(b) [5 marks] Give the time complexity of this algorithm in big-Oh. Explain your answer.
Marking Scheme
1. Marking scheme for Question 1.
1 points
Correctness
Correct answer
0.5 points
Correct order, not big-Oh
0 points
Incorrect answer
2. Marking scheme for Question 2a, 2b, 3a, and 3b.
3 points
Correctness
Explanation
Correct
given
explanation
2 points
1 points
0 points
Correct answer
Correct order, not big-Oh
Incorrect answer
Mostly correct explanation
Somewhat correct explanation
Incorrect explanation
2

Purchase answer to see full
attachment

Explanation & Answer:

3 Questions

User generated content is uploaded by users for the purposes of learning and should be used following our honor code & terms of service.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20