0% found this document useful (0 votes)
3 views

Module 3

Uploaded by

pradeepshettar50
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Module 3

Uploaded by

pradeepshettar50
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

The National Institute of Engineering, Mysuru

Department of Computer Science and Engineering

Data Structures and Applications - BCS304


Module 3 – Question Bank
1. Demonstrate using examples, how operations are performed on a stack implemented using arrays.
2. Write a C program which performs push, pop and peek operations on a stack of integers. Assume
array-based implementation of stack.
3. Demonstrate using examples, how operations are performed on a stack implemented using linked
list.
4. Write a C program which performs push, pop and peek operations on a stack of integers. Assume
linked list-based implementation of stack.
5. Write a program to demonstrate stack overflow and underflow conditions when using a linked list
to represent a stack.
6. Convert the following infix expression to postfix expression using a stack. Show the contents of
stack and output expression at each step.
A+B*C/(E-F)
7. Demonstrate using an example how a postfix expression can be evaluated using stack.
8. Explain the algorithm for converting an infix expression to a postfix expression using a stack.
9. Explain the algorithm for evaluating a postfix expression using stack.
10. Design a stack to evaluate the postfix expression 5 3 + 8 2 - *. Show the intermediate stack contents
for each step of the evaluation.
11. Using a stack, implement a solution to reverse a string.
12. Implement a function to check if a given string is a palindrome using a stack implemented with a
linked list.
13. Write a recursive program to find the factorial of a given non-negative integer.
14. Demonstrate how recursion works taking a simple example.
15. Demonstrate using examples, how operations are performed on a linear queue implemented using
arrays.
16. Write a C program which performs insert, delete and display operations on a simple queue of
integers. Assume array-based implementation of queue.
17. Demonstrate using examples, how operations are performed on a simple queue implemented using
linked list.
18. Develop a function to reverse a queue using only basic queue operations.
19. Write a program that uses a queue implemented with an array to simulate a ticket counter system
where customers are served in the order they arrive.
20. Discuss the advantages of using a linked list to implement a queue in dynamic systems where the
size of the queue is not known beforehand.
21. Write a C program which performs insert, delete and display operations on a linear queue of
integers. Assume linked list-based implementation of queue.
22. Explain the disadvantages of simple queues and how circular queue overcomes it using examples.
23. Demonstrate the working of circular queue implemented using an array.
24. Using a circular queue, write a function to implement a round-robin scheduler for n processes,
each requiring a given number of time units to complete. Demonstrate for n = 3 processes with
time units: [4, 2, 6].
25. Demonstrate the working of priority queue implemented using an array.
26. Demonstrate the working of priority queue implemented using un-sorted linked list.
27. Demonstrate the working of priority queue implemented using sorted linked list.

You might also like