10050301 DS QuestionBank
10050301 DS QuestionBank
Question Bank
Program (UG/PG) : UG
Semester : 3rd
CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology
1. Briefly explain various linear and non-linear data structures along with
theirapplications.
2. Explain the following terms in brief
a) Primitive data structure
b) Non-primitive data structure
c) Linear data structure
d) Non-linear data structure
e) Recursion
f) Time complexity of an algorithm
3. Which data structure is used in a time sharing single central processing unit and
one main memory computer system where many users share the system
simultaneously?
4. How users are added for use of the system?
5. How primitive data type floating point is stored in computer?
6. Differentiate between linear and non-linear data structures.
7. What is the problem with sign and magnitude representation if addition of +7
with -6 is performed? Evaluate 7+7 using 2’s complement representation and
modulo 16 arithmetic
8. Write an algorithm for calculating square of the number for all the prime
numbersranging between 1 to n. Perform time and space analysis. (Winter
2017)
9. Short Questions.
a) Define data structure
b) What is the worst case time complexity of searching an element in a list? How?
10. What are the various operations that can be performed on different Data Structures?
11. What is Recursion?
12. Differentiate between the iterative and recursive method.
CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology
1. A two dimensional array is stored row by row, then what is the address of matrix
element A[i,j] for n row and m column matrix? How array representation of
polynomial 2x2+5xy+y2can be done?
2. Write a pseudo-code for PUSH and POP operations of stack.
3. Draw a binary expression tree for the following and perform preorder traversal
for thesame: (A + B $ C) + (D + E * F)
4. Enlist and briefly explain various applications of stack.
5. Convert the following infix expression into postfix.
A +B – C * D * E $ F $ G .
6. Write an algorithm to check if an expression has balanced parenthesis
usingstack.
7. Evaluate the following postfix expression using a stack. Show the stack
contents.AB*CD$-EF/G/+ A=5, B=2, C=3, D=2, E=8, F=2, G=2
8. Explain various applications of queue.
9. Write algorithm(s) to perform INSERT_FIRST (to insert a node at the first
position) and REVERSE_TRAVERSE (to display the data in nodes in reverse order)
operationsin doubly linked list.
10. What is prefix notation? Convert the following infix expression into prefix.
11. What is postfix notation? What are its advantages? Convert the
followinginfix expression to postfix. A$B-C*D+E$F/G
12. What is the advantage of circular queue? Write an algorithm for inserting
‘A’,’B’,’C’,delete ‘A’ and ‘B’and insert ‘D’ and ‘E’ in circular queue
13. Write recursive algorithm for computing factorial. Which data structure can
be usedto implement this algorithm?
14. How does priority queue work?
15. Perform following operations in a circular queue of length 4 and give the
Front, Rearand Size of the queue after each operation.
a. Insert A, B
b. Insert C
c. Delete
d. Insert D
e. Insert E
f. Insert F
g. Delete
16. Differentiate between arrays and linked list.
(i) In which case insertion and deletion cannot be performed in stack?
(ii) How stack can be used to recognize strings aca,bcb,abcba,bacab,abbcbba?
Showthe trace of contents of stack for recognizing the string abcba.
17. Write an algorithm for simple queue with ENQUEUE operations.
18. Write an algorithm to reverse a string using stack.
CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology
CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology
45. Write a C program to implement a circular queue using array with all
necessaryoverflow and underflow checks.
46. Write a program to insert and delete an element after a given node in a singly
linkedlist.
47. Given a linked list whose typical node consists of an INFO and LINK field.
Formulatean algorithm which will count the number of nodes in the list.
48. Discuss the variations of a queue
49. What is the need of doubly linked list? Consider a problem of inserting a node
into adoubly linked linear list to the left of a specified node whose address is
given by variable M. Give details of algorithm
50. Short Questions.
a. List operations performed on a stack.
b. Mention variations of the queue data structure
51. Create a doubly circularly linked list and write a function to traverse it.
52. Explain the following terms in brief
a. Double-ended queue
b. Priority queue
c. Circular linked list
53. What is Stack and where it can be used?
54. What is a Queue, how it is different from stack and how is it implemented?
55. What are Infix, prefix, Postfix notations?
56. What is a Linked List and What are its types?
57. Can doubly linked be implemented using a single pointer variable in every node?
58. Convert a+b*c-d/e*h to postfix.
59. Convert ((a+b^c^d)*(e+f/d)) to postfix.
60. Which stack operations are needed for performing conversion from infix to
postfix?Write the algorithm.
CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology
CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology
CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology
CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology
CE / IT / CSE / AI / CS 10050301 - DS