You are on page 1of 1

Date: 21-10-2021

DS (KCS-301)

Assignment III

(Submission Date 25th Oct 2021)

1. Why circular queue is better than Linear queue? Write C function to insert an element
into and to delete an element from a circular queue.
2. What are various types of queue? Explain two variants of deque? What type of
linked list is used to implement deque in computer memory? Also describe priority
queue Giving an area where it is widely used.
3. What are various operations that stack supports? What are various applications of
stack? Write algorithm to insert an element into and delete an element from a stack.
Also write an algorithm to get the element on top of the stack.
4. Define recursion. What are its types. Explain Tail recursion with one example.
5. What are advantages and disadvantages of using recursive program. How do you
compare recursion and iteration?
6. Solve the Tower of Hanoi problem with 3 rings. Also write C function to implement
Tower of Hanoi for n rings.
7. Convert the infix expression A-((B*C)+D)/E into postfix expression. Also evaluate
it if A=9, B=3, C=4,D=8 and E=4.
8. Convert the infix expression (A-B/C)*(A/K-L) into prefix expression. Also evaluate
it if A=12, B=8, C=2,K=3 and L=4.

You might also like