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

DS

DSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDS

Uploaded by

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

DS

DSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDSDS

Uploaded by

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

★ DATA STRUCTURE QUESTIONS ★

Q1 & Q2
1. What is ADT? Explain stack as an ADT.
2. Write a structure for stack using array. Write PUSH and POP function for stack using array.
3. Write a ‘C’ Function to Push and POP elements from a stack of characters using an array.(Repeated)
4. Write a function PUSH and POP in ‘C’ for stack using linked list.
5. What are the applications of Stack? Represent stack for decimal to binary conversion: (56)₁₀ to (--)₂.
6. Evaluate the following postfix expression with the help of a stack: 5 3 + 6 2/*3 5*+
7. Convert the following infix expression to postfix using stack (show all steps): a + b * (c / d $ a) / b
8. Convert the given infix expression to a postfix expression using a stack:
(a ^ b) * c – d / d (Note: ^ = Exponent operator)
9. Identify the expression and convert them into the remaining two forms:
i) AB + C * DE – FG + + $
ii) – A / B * C $ DE (Note: $ = Exponent operator)
10. Convert the following prefix expression into infix form. Show all the steps and stack contents:
*-A/BC-/AKL
11. What is Queue? Explain insertion and deletion operation in a Queue with a suitable diagram.
12. Write C functions for:
i) Enqueue in Linear Queue
ii) Dequeue in Circular Queue
13. Define Queue. What are the conditions for ‘Queue empty’ and ‘Queue full’ when a queue is
implemented using an array? Explain. (Repeated)
14. Write a ‘C’ function for deletion in a queue using an array.
15. Write a ‘C’ function to insert and delete an element from a queue using an array.
16. Write ADD and DELETE functions in ‘C’ for a Queue using an array.
17. Explain with examples: i) Linear Queue ii) Circular Queue
18. What are the disadvantages of the linear queue? Suggest a suitable method to overcome them.
19. Write a short note on the circular queue. Compare it with a linear queue.
20. Compare Stack and Queue. What are the advantages of a circular queue over a linear queue?
21. Consider the following circular queue of characters and size 5.
Front points to A, and Rear points to C. Show the circular queue contents for the following
operations at every step:
i) F is added to the queue.
ii) Two letters are deleted.
iii) K, L, M are added to the queue.
iv) Two letters are deleted.
v) R is added to the queue.
vi) Two letters are deleted.
22. Compare Stack and Queue. What are the advantages of a circular queue over a linear queue?
(Repeated).
23. What are the applications of a Queue? Explain two applications in detail.
Q3 & Q4
1. Write structure definition for single Linked List. Differentiate between static memory and dynamic
memory allocation.
2. What is a singly linked list? Write C function for inserting a node at a given location into a singly
linked list. (Repeated)
3. Write structure definition for doubly linked list. {Differentiate between array and linked list.}
{Repeated}
4. State the limitations of arrays. Draw and explain doubly linked list.
5. Explain doubly linked list (DLL). What are the advantages of DLL over SLL?
6. Differentiate singly linked list and doubly linked list.
7. Compare linked representation and array representation with reference to the following aspects:
i) Accessing any element randomly
ii) Insertion & deletion of an element
iii) Utilization of memory
8. Write the following C functions in SLL:
i) Insert a node at the beginning
ii) Delete a node at the end
9. Write the following C functions in circular SLL:
i) Insert a node at the end
ii) Delete all nodes in the list
10. Write a C function to delete a number from a singly linked list.
11. Write a C function to insert a number at the end into the singly linked list.
12. Explain traversal operations in a singly linked list.
13. State the limitations of a single linked list. Represent the following polynomial using a linked list:
20x9 + 15x7 + 10x5 + 5x + 50
14. Write limitations of arrays over linked lists. Represent the following polynomial using a singly linked
list: 23x9 + 18x7 + 41x6 + 16x4 + 3 (Repeated)
15. Write a short note on the Circular Linked List.
16. Draw and explain the circular linked list. State the limitations of a single linked list. (Repeated)
17. Write a ‘C’ function for inserting a number at the front of the circular linked list. (Repeated)
18. What is a doubly linked list? Write a ‘C’ function for inserting a number at the end of the doubly
linked list.
19. A doubly linked list with numbers to be created. Write node structure and a ‘C’ function to create a
doubly linked list.
20. Compare circular linked list with singly linked list in terms of pros and cons.
Q5 & Q6
1. Define binary tree. Name and explain with a suitable example the following terms:
i) Root node
ii) Left sub-tree and right sub-tree
iii) Depth of tree (Repeated)
2. Define the following terms with respect to Trees:
i) Root
ii) Subtree
iii) Level of node
iv) Depth of tree
v) Siblings (Repeated)
3. Define a tree. Explain with a suitable example how a binary tree can be represented using an array.
4. Explain with a suitable example how binary tree can be represented using:
i) Array ii) Linked List (Repeated)
5. Construct the Binary Search Tree (BST) from the following data:
CAR, BAG, MAN, ADD, SAD, FAN, TAN
6. Construct the binary search tree (BST) from the following elements: 45, 20, 80, 40, 10, 90, 70
Also, show pre-order and post-order traversal for the same.
7. Construct the Binary Search Tree (BST) from the following data: 5, 2, 8, 4, 1, 9, 7
Also, show pre-order, post-order, and in-order traversal for the same. (Repeated)
8. Construct Binary Search Tree of the following:
MAR, OCT, JAN, APR, NOV, FEB, MAY, DEC, JUN, AUG, JUL, SEP
9. Define BST? Create a BST for the following data: 14, 15, 4, 9, 7, 18, 3, 5, 7
10. Construct the binary search tree from the following elements: 15, 4, 16, 8, 2, 18, 14
Also, show pre-order, in-order, and post-order traversal for the same.
11. Write a recursive function for in-order, pre-order, and post-order traversal of a binary tree.
12. Write a recursive ‘C’ function for in-order, pre-order, and post-order tree traversal.
13. Write a recursive ‘C’ function for in-order and pre-order traversal of a Binary Search Tree.
14. Write an algorithm to implement non-recursive in-order traversal of a binary search tree.
15. What is an AVL tree? Explain all the rotations in AVL tree. Construct an AVL tree for the following
data: 1, 2, 3, 4, 5, 6
16. Explain the basic concept of AVL tree. Also, explain the four rotations in AVL tree.
17. The post-order and in-order traversals of a binary tree are given below. Is it possible to obtain a
unique binary tree from these traversals? If yes, obtain the tree; if not, give justification.
In-order Traversal: D B F E G A H I C
Post-order Traversal: D F G E B I H C A
18. Write an algorithm to insert an element in a binary search tree implemented using linked
representation.
19. Write a pseudo-code to search an element in a binary search tree using arrays.
Q7 & Q8
1. Draw adjacency list and adjacency matrix for the following graph.
2. Represent the following graph using the adjacency matrix and adjacency list.
3. Represent the following graph using the adjacency matrix and adjacency list.
4. What do you mean by adjacency matrix and adjacency list? Give the adjacency matrix and
adjacency list for the graph shown below.
5. Define Graph. Explain types of Graph.
6. Define with an example:
i) Undirected Graph
ii) Directed Graph
iii) Weighted Graph (Repeated)
7. Define with an example:
i) Path
ii) Cycle
iii) Connected graph
8. Define in-degree and out-degree of a vertex in a graph. Find the in-degree and out-degree of the
given graph.
9. Define in-degree and out-degree of a vertex in a graph. Find the in-degree and out-degree of the
given graph.
10. Define in-degree and out-degree of a vertex in a graph. Find the in-degree and out-degree of the
given graph.
11. Define DFS and BFS graph with example.
12. Explain with a suitable example, DFS and BFS traversal of a graph. (Repeated)
13. Compare DFS and BFS.
14. What is MST? Explain with a suitable example Kruskal’s Algorithm to find MST.
15. Explain Kruskal’s Algorithm. Find the minimum spanning tree for the given graph using Kruskal’s
Algorithm.
16. Find the Minimum Spanning Tree of the following graph (figure 3) using Kruskal’s Algorithm.
17. Find the Minimum Spanning Tree of the following graph (figure 3) using Kruskal’s Algorithm.
18. Find the Minimum Spanning Tree of the following graph using Prim’s Algorithm. Show all the steps.
19. Explain Dijkstra’s Algorithm with an example.
20. Find the shortest path from node 'a' to all nodes in the graph shown in fig. 4 using Dijkstra’s
Algorithm.
21. Find the shortest path from node 'a' to all nodes in the graph shown in fig. 4 using Dijkstra’s
Algorithm.
22. Explain with a suitable example the techniques to represent a graph. (Note: Consider a graph with a
minimum of 6 vertices.)

🤩🤩🤩🤩🤩🤩🤩

You might also like