0% found this document useful (0 votes)
17 views9 pages

10050301 DS QuestionBank

The document is a question bank for the Data Structures subject at Gandhinagar Institute of Technology for the academic year 2024-25. It includes questions divided into four units covering various topics such as linear and non-linear data structures, algorithms, tree structures, and hashing techniques. Each unit contains multiple questions that test knowledge on definitions, algorithms, applications, and comparisons of different data structures.
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)
17 views9 pages

10050301 DS QuestionBank

The document is a question bank for the Data Structures subject at Gandhinagar Institute of Technology for the academic year 2024-25. It includes questions divided into four units covering various topics such as linear and non-linear data structures, algorithms, tree structures, and hashing techniques. Each unit contains multiple questions that test knowledge on definitions, algorithms, applications, and comparisons of different data structures.
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/ 9

Gandhinagar Institute of Technology

DOC NO: 4026

Question Bank

Program (UG/PG) : UG

Name of Department : CE / IT / CSE / AI / CS

Academic Year : 2024-25

Semester : 3rd

Subject Code : 10050301

Subject Name : Data Structures

Name of the Institute : GIT

CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology

UNIT -1: INTRODUCTION TO DATA STRUCTURE

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

UNIT -2: LINEAR DATA STRUCTURE

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

19. Write a program to implement stack using linked list.


20. Write a program to implement circular queue using array.
21. Evaluate the following postfix expression using stack:
(a) 9 3 4 * 8 + 4 / - (b) 5 6 2 + * 1 2 4 / - +
22. Explain the concept of circular queue. Compare circular queue with simple queue
23. Write ‘C’ functions to implement INSERT_FIRST (to insert a node at the first
position), DELETE_FIRST (to delete a node from the first position), DELETE_LAST
(delete a node from the last position) and TRAVERSE (to display the data in
nodes) operations in circular linked list.
24. Write a ‘C’ program to implement stack using linked list.
25. Write an algorithm to perform various operations (insert, delete and
display) forsimple queue.
26. Write differences between simple queue and circular queue. Write an algorithm
for insertand delete operations for circular queue.
27. Write ‘C’ functions to: (1) insert a node at the end (2) delete a node from the beginning
of a doubly linked list.
28. Write an algorithm to reverse a string of characters using stack.
29. Write ‘C’ functions to implement DELETE_FIRST_NODE and TRAVERSE operations in
doubly linked list.
30. Compare: (1) Linked-list and Array (2) Circular queue and Simple
Queue.
31. Convert (A + B) * C – D ^ E ^ (F * G) infix expression into prefix format
showingstack status after every step in tabular form.
32. Write a program to implement a circularly linked list.
33. What is a header node? Explain its importance.
34. Write an algorithm to count the number of nodes in a singly circularly linked list.
35. List the advantages of a doubly linked list over singly linked list.
36. Write an algorithm to swap two nodes, n and n+1, in a singly linked list.
37. Evaluate the following postfix expression using a stack. Show the steps.
2$3+5*2$2–12$6
38. Consider the stack S of characters, where S is allocated 8 memory cells.
S: A,C,D, F, K, _, _, _
39. Write a program to implement queue and check for boundary conditions.
40. Write an algorithm to convert an infix expression to postfix expression.
Showthe working of the algorithm for the following
expression.(Summer 2018) A+B*C/D$E-(F*G)
41. Write an algorithm to implement insert and delete operations in a simple
queue.
42. Describe: (1) Recursion (2) Priority Queue (3) Tower of Hanoi
43. Write a ‘C’ functions to: (1) insert a node at beginning in singly linked list (2)
insertan element in circular queue.
44. Write a C program to implement a stack with all necessary
overflow andunderflow checks using array.

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

UNIT -3: NONLINEAR DATA STRUCTURE

1. Explain AVL trees .


2. Define complete binary tree and almost complete binary tree.
3. Mention the properties of a B-Tree.
4. Insert the following elements in a B-Tree.
a, g, f, b, k, c, h, n, j
5. List advantages and disadvantages of Breadth First Search and
Depth FirstSearch.
6. Construct a binary search tree from the following traversals:
a. Inorder: 3 4 5 6 7 9 17 20 22
b. Preorder: 9 4 3 6 5 7 17 22 20
7. Construct a binary search tree for the following and perform
inorder andpostorder traversals:
594821376
8. Explain deletion in an AVL tree with a suitable example.
9. Construct a binary tree from the traversals given below:
a. Inorder: 1, 10, 11, 12, 13, 14, 15, 17, 18, 21
b. Postorder: 1, 11, 12, 10, 14, 18, 21, 17, 15, 13
10. Write Kruskal’s algorithm for minimum spanning tree with an example.
11. With a suitable example, explain steps for conversion of a general tree
into abinary tree.
12. Explain Threaded binary trees with suitable examples.
13. Explain Depth First Search in graphs with an example.
14. Write ‘C’ functions for: inserting a node, postorder traversal and counting total number
of nodes for binary search tree.
15. Explain Depth First Search and Breadth First Search in graphs with an
example.
16. With figure, explain the following terms: (1) Depth of a tree (2) Sibling nodes (3)
Strictlybinary tree (4) Ancestor nodes (5) Graph (6) Minimum spanning tree (7)
Degree of a vertex
17. Generate a binary search tree for following numbers and perform in-order
and post-order traversals: 50, 40, 80, 20, 0, 30, 10, 90, 60, 70
18. Explain Right-in-threaded, left-in-threaded and full-in-threaded binary trees.
19. Write Kruskal’s algorithm for minimum spanning tree and explain with an example.
20. What is binary tree traversal? What are the various traversal methods?
Explain anytwo with suitable example.
21. What is a binary search tree? Create a binary search tree for inserting the
following data.a. 50, 45, 100, 25, 49, 120, 105, 46, 90, 95
22. Explain deletion in the above tree.

CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology

23. Short Questions.


a. Mention one operation for which use of doubly linked list is preferred over the
singly linked list
b. Write an algorithm/steps to traverse a singly linked list.
c. What is a header node and what is its use?
24. Is Queue a priority queue? Justify
25. What is a binary search tree? Create a binary search tree for the
following data. 14, 10, 17, 12, 10, 11, 20, 12, 18, 25, 20, 8, 22, 11, 23
26. Explain deleting node 20 in the resultant binary search tree.
27. Explain the working of the Kruskal’s algorithm.
28. Write the algorithm for binary search and find its complexity.
29. Insert the following letters into an empty B-tree of order 5
30. Define the following terms with respect to a graph: Node, Edge, Path
31. Discuss different representations of a graph.
32. Explain insert and delete operations in AVL trees with suitable examples.
33. How directed tree can be represented?
34. A communications network is represented by graph. Each node represents a
communication line and each edge indicate the presence of interconnection
between thelines. Which traversal technique can be used to find breakdown in
line? Explain.
35. The Preorder traversal of the tree is: 7, 1, 0, 3, 2, 5, 4, 6, 9,
8, 10The inorder traversal of the tree is :
01,2,3,4,5,6,7,8,9,10 What is the postorder traversal?
How a general tree can be converted to binary tree?
36. Short Questions.(Winter 2016)
a. Define: Height of a tree.
b. What is the height of a complete binary with n nodes?
c. Give two applications of graphs.
37. Explain the following terms in brief
a. Complete binary tree
b. 2-3 tree
c. Minimum spanning tree
d. Degree of vertex
38. Which data structures are used for BFS and DFS of a graph?
39. How to check if a given Binary Tree is BST or not?
40. What is a B tree?
41. Describe the following term in a tree.
a) Level b) Height c) Degree.

CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology

UNIT -4: HASHING AND FILE STRUCTURES

1. Discuss various rehashing techniques


2. Describe various collision resolution techniques in hashing.
3. What is hashing? What are the qualities of a good hash function? Explain
any twohash functions in detail.
4. How following hash functions work?
(i) The midsquare method
(ii) Digit analysis
5. Discuss various methods to resolve hash collision with suitable examples.
6. Hash function map several keys into same address called collision.
Howcollision resolution techniques work?
7. Explain indexing structure for index files.
8. List the qualities of a good hash function.
9. What is hashing? Explain hash collision and any one collision
resolutiontechnique
10. Explain two hash functions.
11. What do you mean by hashing?
12. Describe all the terms associate with hash table.
13. Write two simple hash functions.
14. Explain the terms in brief Hash collision

CE / IT / CSE / AI / CS 10050301 - DS
Gandhinagar Institute of Technology

UNIT -5: SORTING & SEARCHING

1. Write a ‘C’ function for Selection sort.


2. Write an algorithm for Binary search method.
3. Write an algorithm for Quick sort.
4. Write a ‘C’ program for Bubble sort.
5. Explain Binary search method.
6. Explain Sequential search method.
7. Write an algorithm for Selection sort method. Explain each step with an
example.
8. Apply quick sort on following data
42 23 74 11 65 58 94 36 99 87
9. “If no interchanges occurred, then the table must be sorted and no further
passes arerequired.” Which sorting method works on this principal?
Apply above sorting technique on the following data: 5 1 4 2 8
10. Apply quicksort algorithm to sort the following data. Justify the steps.
42, 29, 74, 11, 65, 58
11. Sort the following numbers using (i) Selection sort (ii) Quick sort:
10 50 0 20 3010
12. Write a ‘C’ program for insertion sort and discuss its efficiency.
13. Short Questions.(Winter 2016)
a. What is the complexity of binary search algorithm?
b. Name two divide and conquer algorithms for sorting.
14. Describe Linear Probing with an example.
15. What is the complexity of the quick sort algorithm on sorted data?
Justify youranswer.
16. Explain the difference between insertion sort and selection sort with an example.
What isthe time complexity of these algorithms? How?
17. Apply merge sort algorithm for the following data and show the steps. (Summer
2018)66, 33, 40, 22, 55, 88, 11, 80, 20, 50, 44, 77, 30
18. What are the factors to be considered during the selection of a sorting techniques?
19. Explain analysis of quick sort algorithm.

CE / IT / CSE / AI / CS 10050301 - DS

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy