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

(Module-2) (Basic Programming Using Data Structure) Qbank

It is a question bank for java programming language.

Uploaded by

ranjanbibek878
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

(Module-2) (Basic Programming Using Data Structure) Qbank

It is a question bank for java programming language.

Uploaded by

ranjanbibek878
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Question Bank 2023-24 GIFT (Autonomous) Bhubaneswar

Subject Name: Programming Using Data Structure Subject Code: (BTBS-T-BS-203)


MODULE –II (Stacks and Queues)

Questions Marks CO BT By
1 Section-A L
1. What is a stack? 2 2 1 A
CP
2. What is a queue? 2 2 1 A
CP
3. What is a priority queue? 2 2 1 A
CP
4. What is a linear queue? 2 2 1 A
CP
5. What is a circular queue? 2 2 1 A
CP
6. Define ADT. 2 2 1 A
CP
7. Differentiate STACK and QUEUE. 2 2 1 A
CP
8. Differentiate LIFO and FIFO. 2 2 1 A
CP
9. Differentiate Linear Queue and Circular Queue. 2 2 1 A
CP
10. Differentiate Queue and Priority Queue. 2 2 1 A
CP
11. List out at least 4 applications of Stack. 2 2 1 A
CP
12. List out at least 4 applications of Queue. 2 2 1 A
CP
13. What are infix, prefix and postfix notations? 2 2 1 A
CP
14. Convert the Following infix expression to postfix notation step by step 2 2 1 A
CP
((A+B*(C-D))/E+F)*G
15. Convert the Following infix expression to prefix notation step by step 2 2 1 A
CP
((A+B*(C-D))/E+F)*G
16. Differentiate prefix notation and postfix notation. 2 2 1 A
CP
17. Write algorithm for push () function of stack. 2 2 1 A
CP
18. Write algorithm for pop () function of stack. 2 2 1 A
CP
19. Write algorithm for peak ()/getTop () function of stack. 2 2 1 A
CP
20. How to know that a stack is either full or empty? 2 2 1 A
CP
21. Evaluate the following postfix expression: 2 2 1 A
ABC*D/+E- CP

Where A= 1, B= 2, C= 8, D= 4, E= 7

Basic Programming Using Data Structure (Module – 2, Stacks and Queues) Page 1
22. Suppose stack content is: 3 4 (from top to bottom) 2 2 1 A
CP
Then, what output pop( ) - pop( ) will generate?

23. W.r.t. a stack with max size 4: push(12), push(34), push(56), push(78), 2 2 1 A
push(90), pop(), pop(), peak(), push(100) CP

What shall be the stack status after the above specified operations?
24. What is “stack overflow” and “stack underflow”? 2 2 1 A
CP
25. Write a C code to insert all the characters of a string into a stack. 2 2 1 A
CP
26. What is Print Queue? 2 2 1 A
CP
27. What is a double ended queue (deque)? 2 2 1 A
CP
28. Perform the operations Enqueue(10), enqueue(20), enqueue(15), dequeue(), 2 2 1 A
enqueue(22), dequeue(), enqueue(13), enqueue(16), dequeue() w.r.t. priority CP
queue. At last display the queue status from front to rear.
29. Perform the operations Enqueue(10, ‘f’), enqueue(20, ‘r’), enqueue(15, ‘r’), 2 2 1 A
dequeue(‘f’), enqueue(22,’f’), dequeue(‘r’), enqueue(13, ‘r’), enqueue(16, CP
‘f’), dequeue(‘r’) w.r.t. a deque. At last display the queue status from front
to rear.

Note: ‘f” represents front, ‘r’ represents rear.


30. If the queue content from front to rear is 2, 3, 4, 5 by considering that 2 2 1 A
elements are enqueued from rear and dequeued from front, evaluate the CP
result of the following expression:

dequeue() + dequeue() * dequeue() –dequeue()


31. Differentiate infix notation and postfix notation. 2 2 1 A
CP
32. Design a function using C to get precedence value of an arithmetic 2 2 1 A
operator. CP
33. Suppose stack content is: 3 4 (from bottom to top) 2 2 1 A
CP
Then, what output pop( ) - pop( ) will generate?
34. How stack is differing from an ordinary array? 2 2 1 A
CP
35. How queue is differing from an ordinary array? 2 2 1 A
CP
36. List out advantages and disadvantages of stack/queue implementation using 2 2 1 A
an array. CP
37. How to know that a stack is full and empty? 2 2 1 A
CP
38. How to know that a linear queue is full and empty? 2 2 1 A
CP
39. How to know that a circular queue is full and empty? 2 2 1 A
CP
40. While converting an infix string to postfix/prefix string, what is the 2 2 1 A
advisable size of postfix/prefix string? Justify your answer. CP

Basic Programming Using Data Structure (Module – 2, Stacks and Queues) Page 2
41. What is the operator found in infix expression but not found in 2 2 1 A
postfix/prefix expression? Explain. CP
42. A
CP

2 BT
Section B L
1. Write an algorithms for push, pop and peak operations for a stack. 6 2 2 A
CP
2. Write algorithms for enqueue and dequeue operations in stack. 6 2 2 A
CP
3. Briefly discuss all the types of Queues. 6 2 2 A
CP
4. List out at least 6 applications of stack with minimal descriptions. 6 2 2 A
CP
5. List out at least 6 applications of queue with minimal descriptions. 6 2 2 A
CP
6. Write an algorithm for enqueue() operation of a priority queue. 6 2 2 A
CP
7. Write a C program for parenthesis matching. 6 2 2 A
CP
8. Write algorithm for enqueue and dequeue operation in a priority queue. 6 2 2 A
CP
9. Write an algorithm for parenthesis matching. 6 2 2 A
CP
10. Define push() and pop() functions of a stack using C. 6 2 2 A
CP
11. Define enqueue() and dequeue() functions of a queue using C. 6 2 2 A
CP
12. Define enqueue() and dequeue() function of a priority queue using C. 6 2 2 A
CP
13. Write an algorithm reverse a string using stack. 6 2 2 A
CP
14. Write a C program to enqueue an element into a deque. 6 2 2 A
CP
15. Write a C program to dequeue an element into a deque. 6 2 2 A
CP
16. Demonstrate the few push and pop operations w.r.t. a stack 6 2 2 A
diagrammatically.(Show the status of top at every step) CP

17. Demonstrate the few enqueue and dequeue operations w.r.t. a linear queue 6 2 2 A
diagrammatically. (Show the status of rear and front counter at every step) CP

18. Demonstrate the 6 enqueue and 3 dequeue operations w.r.t. a circular queue 6 2 2 A
(with maximum capacity of 5 elements) diagrammatically. (Show the status CP
of rear and front counter at every step)

19. Design a Stack application to swap two numbers. 6 2 2 A


CP
20. 6 2 2

Basic Programming Using Data Structure (Module – 2, Stacks and Queues) Page 3
3 Section C

1. Write a C program for Circular Queue. 8 2 3 A


CP
2. Write a C program to reverse a string using stack. 8 2 3 A
CP
3. Write an algorithm to evaluate a postfix expression. 8 2 3 A
CP
4. Write a C program to evaluate a postfix expression. 8 2 3 A
CP
5. Compare and contrast queue, circular queue, priority queue, deque. 8 2 3 A
CP
6. Write algorithms for equeue and dequeue operations of Circular Queue. 8 2 3 A
CP
7. /-4*+1235 8 2 3 A
CP
Evaluate the above postfix expression step-by-step and demonstrate the
status of stack at every step.

8. Write a C program to create a main stack and divide the main stack into 8 2 3 A
two stacks such that one stack should contain only odd numbers and CP
another stack should contain only even numbers of the numbers pushed
into main stack.
9. Write a C program to create a stack and move the stack content to a queue. 8 2 3 A
CP
10. Design algorithms for different operations in deque. 8 2 3 A
CP
11. Write an algorithm and a C program to evaluate a postfix expression. 8 2 3 A
CP
12 Write a stack application with all basic functionalities, where the stack 8 2 3 A
contains set of floating point values. CP
13 Write a stack program to store all the digits of a number in the stack. 8 A
CP
14. Write a C program to add all the numbers present in a stack. (Make 8 A
sure that stack content should not be changed.) CP
15 Write a C program to find binary equivalent of an integer values 8 A
using stack. CP

4 Section D 4,5,
6
1. Write algorithm for converting an infix expression to postfix expression 10 2 4 A
CP
2. Write a C program to convert an infix expression to postfix equivalent. 10 2 4 A

Write a C program for implementing a Priority Queue using 10


CP

an array.
3. 2 4 A
CP

4. Write a C program to demonstrate different operations in deque. 10 2 4 A


CP
5. ( A * ( B + C ) + D) – E ) / ( F – G * I ) / J 10 2 4 A
CP
Convert the above infix expression into postfix expression step-by-step and

Basic Programming Using Data Structure (Module – 2, Stacks and Queues) Page 4
demonstrate the status of postfix string and stack at every step.

** BTL: Bloom’s Taxonomy Level

** CO: Course Outcomes

Basic Programming Using Data Structure (Module – 2, Stacks and Queues) Page 5

You might also like