0% found this document useful (0 votes)
41 views11 pages

DATA STRUCTURES(Previous year question)

The document contains a series of questions and tasks related to data structures, covering topics such as queues, linked lists, trees, and graphs. It includes definitions, algorithms, and examples for various data structures and their operations. The questions are structured for examination purposes, spanning multiple sessions and focusing on practical applications and theoretical concepts.

Uploaded by

dheerajjha0276
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)
41 views11 pages

DATA STRUCTURES(Previous year question)

The document contains a series of questions and tasks related to data structures, covering topics such as queues, linked lists, trees, and graphs. It includes definitions, algorithms, and examples for various data structures and their operations. The questions are structured for examination purposes, spanning multiple sessions and focusing on practical applications and theoretical concepts.

Uploaded by

dheerajjha0276
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/ 11

DATA STRUCTURES(ETCS-209)

UNIT-1

(2014 Sessional exam)


Q1)Define a double ended queue.What are its types?
Q2)What are linear list?What are its types?
Q3)Reverse a linked list without using a pointer?
Q4)Convert the following infix expression into a postfix expression using a stack
[a+(b-c)]*[(d-e)/(f+g-h)]
Q5)If you are using C language to implement the heterogeneous linked list,what pointer type
will you use.
Q6)Write an algorithm or pseudo code to extract characters from a given string from a given
position of n characters and store it in another string which is initialized at runtime.
Q7)What is Abstract Data type and its implementation through data structures?
Q8)How will you check the validity of an expression containing nested parenthesis?
Q9)Write a Pseudocode/algorithm for
(a)insertion at the end of a circular linked list
(b)Deletion of a anode with a given data in a doubly linked list
Q10)How can we use a linked list to store a sparse matrix.
Q11)Write a pseudo code/algorithm to remove duplicate element from a list?
Q12)Consider a float arrayAPR(2:8,-4:1),6:10)whose base address is 200.Find the address of
APR(5,-1,8)
Q13)Consider a circular queue with fixed 5 position.Find the value of front and rear when
following operations are performed
(a)A,B,C inserted
(b) A is deleted
(C) D and E is deleted
(d) B and C is deleted
(e) F inserted
(f) D deleted
(g) G and H inserted
(Jan 2015 end term)
Q14)Difference between stack and queue.
Q15)Use a stack to evaluate the following arithmetic expression.Show the changing stack of
the stack in tabular form
XYZ^*AB/C+-for X=1,Y=5,Z=2,P=3,A=15,B=3,C=8
Q16)Write a short note on complexity of program.
(Sept 2015 sessional exam)
Q17)Write an algorithm to perform POP operation on stack using singly linked list.(2)
Q18)What is the difference between ground header linked list and circular header linked
list(2)
Q19)What is the condition that a circular queue is full if the queue is implemented using
arrays?(1)
Q20)What is time space trade off?
Q21)Write a procedure /program to reverse a single linked list without using any more
memory?(2)
Q22)Consider the following infix expression and convert into reverse polish notation using
stack(5)
(A+(B*C-(D/E^F)*G)*H)
Q23)What is an algorithm /program for inserting and deleting a node at a given location in
circular linked list.(5)
Q24)Suppose multidimensional arrays A and B are declared as A(-2:2,2:22)and B(1:8,-5:5,-
10:5)stored in column major order.
a) Find the length of each dimension of A and B.(2.5)
b) The number of elements in A and B(1)
c) Consider the elements B(3,3,3) in B.Find the effective indices E1,E2 and E3,and the
address of element assuming base (b)=400 and there are w=4 words per memory
loacation.(2.5)
Q26)What is garbage collection
Q27) Write algorithm/program for insertion operation on queue using singly linked list.
(Dec 2015 End term)
Q28) Define infix expression and postfix expression with example.Mention its advantage.(5)
Q29)Write an algorithm /program which convert a postfix expression to a prefix expression
.Give an example?(6)
Q30)Write an implementation of the queue Abstract data type using two stacks.Write an
algorithm for Enqueue and dequeuer operation
(Sept 2016 sessional exam)
Q31)What are the two main factors for measuring the performance of an algorithm?Explain
in brief.(2)
Q32)Define time space trade off?(2)
Q33)Write a program /algorithm to evaluate a postfix expression using stack?Consider the
following infix expression and convert it into postfix expression using stack.(2+3)
(A+(B*C-(D\E^F)*G)*H)
Q34)What is an algorithm /program for deleting a node at a given location in circular linked
list.(3)
(End term examination Dec 2016)
Q35)Consider a linear array aaa(5:50),bbb(-5:10) and cc(18).(8.5)
(a)Find the number of elements in each array.
(b)Suppose Base(aaa)=300 and w=4,words for memory cell for aaa.Find the address of
aaa[15],aaa[35] and aa[55].
Q36)Write a program /algorithm to evaluate a postfix expression using stack?Consider the
following infix expression and convert it into postfix expression using stack.(2+3)
(A+(B*C-(D\E^F)*G)*H)
Q37)Write a procedure /program to reverse a single linked list without using any more
memory?(6)
(Sept 2017 sessional exam)
Q38)Convert a given infix expression into postfix expression .Demonstrate the steps of
conversion.(2)
a+b*c-(d/e^f)*g)*h
Q39)What is doubly linked list?(2)
Q40)What pointer type is used to implement a heterogeneous list in C.Explain in brief?(2)
Q41)Calculate the address of element at X[4,3]in a 2D array X[1.5][1.4]storedin row major
order.Assume the base address to be 1000 and each element requires 4 words of storage.(5)
Q42)Write an algorithm to delete the last node of a linked list.(5)
Q43)Consider the following circular queue with storage size 6.
FRONT=2,REAR=4,QUEUE:_,L,M,N,_,_
Describe the queue as following operation takes place
1Add O
2Add P
3Delete two elements
4.Add Q,R,S
5.Delete one
(End term examination dec 2017)
Q44) What is an abstract data type(2.5)
Q45)What is a self referential structure?(2.5)
Q46)List the major difference between a stack and queue .Write an algorithm to add a node at
the end of a circular linked list(12.5)
Q47)How to convert infix expression into a postfix expression .Write a program to carry out
this conversion and illustrate the conversion of AB*C-D+E/F into a postfix expression(12.5)
(Sessional exam Sept 2018)
Q48)Calculate the postfix expression using stack also demonstrate the steps(2)
5,3,+,8,2,-,*
Q49)What do you understand by time space trade off?(2)
Q50)Differentiate between array and linked list?(2)
Q51)Briefly explain different type of queues?(2)
Q52)Explain different types of linked list?(5)
Q53)Write an algorithm to delete the second –last node of a doubly linked list.(5)
Q54)Write the algorithm for PUSH and POP operation in stack.(4)
(End term exam dec 2018)
Q55)What is the condition to check the overflow and underflow condition in circular
queue.(2.5)
Q56) What is header linked list?(2.5)
Q57)Explain doubly ended queue.(2.5)
Q58)A 2-dimensional array X[5][4] is stored row-wise in the memory .The Ist element of
array is stored at loacation 80.Find the memory loacation of X[3][2] if each element of array
required 4 byte memory space. (6)
Q59)Transform the following infix expression into postfix expression using stack(6.5)
A+(B*C-(D/E^F)*G)*H
Q60)Write an algorithm/program to implement queue using linked list.(6)
Q61)What is circular linked list ?What are its advantages over linear linked list?Write an
algorithm to insert a node at desired position in circular linked list.(6.5)
UNIT-2
(End term examination Jan 2015)
Q62)Following list of numbers is inserted in order into an empty binary search tree
45,32,90,34,68,72,15,24,30,66,11,50,10
(a)Construct binary search tree.
(b) Find the inorder,preorder,postorder traversal of BST created.
Q63)For the following sequence determine the binary heap obtained when the keys are inserted
one by one in order given into an auxillary empty heap.
16,14,10,8,7,9,3,2,4,1
Q64)Define the (a)AVL Tree
(b)Expression tree
(Sessional exam sept 2015)
Q65)How was the resulting BST will look if the input is already sorted in non –decreasing
order.(1)
Q66)Construct the binary tree T from the following sequence(2)
Preorder:ABDGCEHIF
Inorder: DGBAHEICE
Q67)Number of nodes in complete tree is 1000000.Find its depth.(1)
Q68)Binary tree with N nodes has exactly _____Null branches.(1)
Q69)Why height balancing tree is required ?Create AVL Tree of the following
a,z,b,y,c,x,d,w,e,v,f
(End term examination dec 2015)
Q70)Draw the tree with the following information
Preorder:G,B,Q,A,C,K,F,P,D,E,R,H
Inorder:Q,B,K,C,F,A,G,P,E,D,H,R
(Sessional sept 2016)
Q71)How the resulting binary search tree will look like if the input is already sorted in non
decreasing order.(2)
Q72)Number of nodes in complete binary tree is 1000000.Find its depth.(2)
Q73) Q69)Why height balancing tree is required ?Create AVL Tree of the following
a,z,b,y,c,x,d,w,e,v,f
Q74) Construct the binary tree T from the following sequence(2)
Preorder:ABDGCEHIF
Inorder: DGBAHEICE
(End term dec 2016)
Q75)What is height balancing tree?Explain with the help of suitable example?(5)
Q76)Explain the following terms used in tree with example- (12.5)
(a) Terminal Node/leaf
(b) Sibling/brother
(c) Level number
(d) Height/depth
(e) Degree of node
(f) Generation
(g) Root
(h) Ancestors and descendent
Q77) Constuct the AVL Tree if following elements are inserted in order
10,20,30,40,50,60,70,80,90,100,150,130,15(12.5)
Q78)What is the role of Binary search tree?Give the algorithm for insertion and deletion of a
node in binary search tree.Give an example.(12.5)
(Sessional Sept 2017)
Q79)What is the maximum height of any AVL Tree with 7 nodes?Assuming height is 0 for a
tree with single node?(2)
Q80)Explain the following terms used in a tree(2)
(a) Terminal node
(b) Siblings
(c) Degree of node
(d) Height of tree
Q81)Insert the following elements in alpahabetical order into an empty binary search tree(7)
J,R,D,G,T,E,M,H,P,A,F,Q
(a)Find the final tree
(b) Find the post-order traversal of tree
Q82)A binary tree has 9 nodes. The inorder and preorder traversals are of T yield the following
sequences of nodes(5)
Inorder:E,A,C,K,F,H,D,B,G
Preorder:F,A,E,K,C,D,H,G,B
Q83)Construct the AVL Tree if the following elements are inserted in order
3,2,1,4,5,6,16,15,14
(End term dec 2017)
Q84)Define expression tree and its usage.(2.5)
Q85)Show that inorder traversal of a BST always produces the sorted output.(2.5)
Q86)What is heap property ?Illustrate the insertion of an element in a heap through an
example.(2.5)
Q87)Define perfect binary tree.How many different binary tree are possible with four
nodes?(2.5)
Q88)Define an AVL tree .What are the different AVL tree rotations?Construct an AVL Tree
for the following list of numbers(12.5)
10,5,8,12,18,22,1,,4,6,30
Q89)Define inorder and postorder traversal of a tree using suitable example
Construct a binary tree with following data(12.5)
Inorder:B,G,D,K,H,A,E,I,C,J,F
Postorder:G,K,H,D.B,E,I,J,F,C,A
(Sessional sept 2018)
Q90) Insert the following elements in alpahabetical order into an empty binary search tree(5)
J,R,D,G,B,E,M,H,P,A,F,Z
(a)Find the final tree
(b) Find the in-order traversal of tree
Q91) A binary tree has 9 nodes. The inorder and preorder traversals are of T yield the following
sequences of nodes(5)
Inorder:E,A,C,K,F,H,D,B,G
Preorder:F,A,E,K,C,D,H,G,B
Q92)Explain the different types of rotation in AVL Tree with the help of suitable examples?(5)
(End term dec 2018)
Q93)Explain threaded binary tree(2.5)
Q94)Constuct an expression tree for the following expression(6)
A+(B-C)*D+(E*F)
Q95)Create an AVL Tree from the given set of values and explain the rotations(6.5)
HIJBAECFDGKL
Q96)Explain the following (6)
(a)BST
(b)Complete binary tree
(c) Heap tree
Q97)Draw the binary tree when inorder and preorder traversal is given as follows
Preorder:ABCDEFGHIJKL
Inorder:BADCFEJHKGL
Write an algorithm for the same(6.5)
UNIT-III
(End term Jan 2015)
Q98)Difference between B+ and B-tree .
(End term Dec 2015)
Q99)What does it mean to say that a graph G is connected and what does it mean to say that
“graph is strongly connected”?(5)
Q100)Define B tree with example.(5)
Q101)What are various graph traversal techniques ?Explain.(5)
Q102) Write algorithm for Prims algorithm.Show how to generate MST using Prims
algorithm.(12.5)
Q103)Write a short note on B+tree?(2)
(End term Dec 2016)
Q104)What are the different ways of representing a graph.(5)
Q105)What do you mean by minimum spanning tree?Generate minimum spanning tree for
the following graph.(6.5)
7 2 12 4 4
8
1 2 10 6
9 6
3
3 5
14
(End term dec 2017)
Q106)Difference between B tree and B+ tree?(2.5)
Q107)A B-Tree of order 4 is built from scratch by 10 successive insertions.What is maximum
number of nodes splitting operations that may take place?(2.5)
Q108)Define B tree structure properties .Consider a B+ tree in which the maximum number of
keys in a node is 7.What is the minimum number of keys in any non-root node ?Explain
insertion and deletion process in a B tree?(12.5)
Q109) How to represent a graph using adjacency linked list?Execute the Breadth First search
algorithm on the following graph starting from the vertex A(12.5)

A B C D

E F G H

(End term Dec 2018)


Q110)Explain the application of DFS?(2.5)
Q111)What is M-Way tree?(2.5)
Q112)Draw the directed graph that correspond to following adjacency matrix.Also write
down the adjacency list corresponding to graph.(6)
V0 V1 V2 V3
VO 0 1 1 0
V1 0 0 1 1
V2 0 0 0 1
V3 1 0 0 0

Q113)Write down the BFS and DFS traversal algorithm for a graph.
Q114)Explain minimum spanning tree .Find the minimum spanning tree for the following
graph using Kruskal algorithm(6)
10
A B
5
3 2 3
8 9 C
G
F 8
8 5 7 3
E D
Q115)Create B-tree of order 5 taking the keys in given order into an initially empty tree
65,71,70,66,75,68,72,77,74,69,83,73,82,88,67,76,78,84,85,80 then delete
75,69,73,88,67.(6.5)
Unit-IV
(End term Jan 2015)
Q116)Differentiate between
(a)merge sort and quick sort
(b)Sequential search and binary search
(c) Direct hashing and digit extraction hashing
Q117)Discuss any two hash function using suitable example?
Q118)Which sorting algorithm is easily adaptable to singly linked list?
Q119)Sort the following numbers using exchange sort and merge sort.Illustrate the
immediate steps as well
100,300,95,60,900,800
(End term dec 2015)
Q120)Define Bubble sort and quick sort with example.Which one is better if data set is small.
Q121)Define the following collision resolution method with example(12.5)
(a)Open addressing
(b)Linear probe
(c)Quadratic probe
Q122)Explain 2 way merge sort.
(End term dec 2016)
Q123)Derive the time complexity of the linear search in average and worst case.(4)
Q124)Explain the selection sort and sort the following elements using selection sort(6)
8,22,7,9,31,19,5,13,58,93,1,45
Q125)Write short note on following(6.25)
(a) Bucket hashing and collision resolution
(End term dec 2017)
Q126)When a sorting procedure is considered to be stable.
Q127)Why quicksort is generally considered to be better than mergesort?Explain Pseudocode
of quicksort and mergesort procedures and compare their performances.(12.5)
Q128)Define separate chaining,linear probing and quadratic probing.Given the
values{2341,4324,2389,430,22,397,3920},a hash table of size 7,and hash function h(x)=x
mod 7,show the resulting tables after inserting the values in the given order with each of
these collision strategy.(12.5)
(End term dec 2018)
Q129)What is bucket hashing?(2.5)
Q130)What is Hashing?Explain various hashing algorithm.Discuss various collision
resolution techniques.(6)
Q131)Write a algorithm for quick sort and perform sorting on following values.(6.5)
75,12,23,58,11,94,6,8,13
Q132)Write algorithm/program for binary search.Explain why binary search is better than
linear search.(6)
Q133)What is the difference between internal and external sorting?Write any one algorithm
for internal sorting and one for external sorting.(6.5)

You might also like