Ds Questionbank

Embed Size (px)

Citation preview

  • 8/10/2019 Ds Questionbank

    1/6

    Babaria Institute of Technology

    Department of Computer EngineeringData structuresQuestion Bank

    LINEAR DATASTRUCTURES

    1 What is Data Structure? Give the difference between Linear and Non Linear DataStructures.

    2 Give the difference between Simple Queue and Circular Queue.

    3 Convert following Infix expression into Postfix expression. a b / c * d + e * f / g

    4 Trace the conversion of infix to postfix form in tabular form.

    (i) ( A + B * C / D - E + F / G / ( H + I ) )(ii) ( A + B ) * C + D / ( B + A * C ) + D

    5 Write an algorithm to implement PUSH, POP and CHANGE Operations on Stack.

    6 Advantages and disadvantages of linked list over array.

    7 Write an algorithm to insert and delete a node in Doubly Linked List.

    8 Write an algorithm/program to implement Delete operation into a Circular Queueusing array representation of Queue

    9 Write an algorithm/program to implement insert operation into a Circular Queueusing array representation of Queue

    10 Write an algorithm to convert infix expression to postfix expression.

    11 Write an algorithm for evaluation of postfix expression and evaluation the followingexpression showing every status of stack in tabular form.

    (i) 5 4 6 + * 4 9 3 / + * (ii) 7 5 2 + * 4 1 1 + /

    12 Explain Difference between Stack and Queue

    13 Consider the following arithmetic expression P, written in postfix notation. Translateit in infix notation and evaluate.

    P: 12, 7, 3, -, /, 2, 1, 5, +, *, +14 What is sparse matrix? Explain

    15 Explain priority queue

    16 Write an algorithm to delete an element from a singly linked list.

    17 What is Tower of Hanoi? Explain it with n=3.

  • 8/10/2019 Ds Questionbank

    2/6

    18 Differentiate between stack & queue. Also explain priority queue

    19 Write difference between singly linked list and doubly linked list.

    20 Convert following expression into postfix notation.(i) A + ( B - C ) * D (ii) A ^ B * C \ D(iii) (A + B) \ C * D

    21 Find value of following postfix expression using stack trace.( i ) 5 4 6 + * 4 9 3 / + *(ii) 3 5 * 6 2 / +.

    22 Write an algorithm to insert an element into a singly link list

    NON LINEARDATASTRUCTURES

    1 Give definition of a) Complete binary tree b) Height of tree

    2 What is 2-3 tree?3 Write a short note on threaded binary tree

    4 What is the meaning of height balanced tree? How rebalancing is done inheight balanced tree.5 Create a binary search tree for the following data :

    50 , 25 ,75, 22,40,60,80,90,15,30.

    6 What is graph? How it can be represented using adjacency matrix, what is pathmatrix? How path matrix can be found out using adjacency matrix .

    7 What is spanning tree ?8 Give the traversal of the following tree a)in order b)post order c)preorder.

    9 Explain BFS and DFS with example10 Write warshall algorithm for graph11 Given the following traversals create a binary tree from that. Also give the postorder

    traversal for the same.

    preorder = {7,10,4,3,1,2,8,11}inorder = {4,10,3,1,7,11,8,2

    12 Define AVL tree. Construct AVL tree for following data10,20,30,40,50,60,70,80

    13 What are the advantages of Multi way search tree over binary search tree?Construct 2-3 tree for the following data12, 50, 85, 6, 10, 37, 100, 120, 25, 70

  • 8/10/2019 Ds Questionbank

    3/6

    15 Define spanning tree and minimum spanning tree. Find the minimum spanning tree ofthe graph shown in figure below.

    16 What are the advantages of Multiway search tree in disc access?Construct B tree of order 5 for the following data1,7,6,2,11,5,10,13,12,20,16,24,3,4,18,19,14,25

    17 Define height of the binary tree. Define height balanced tree with its advantages.Construct a height balanced binary tree (AVL tree) for thefollowing data42,06,54,62,88,50,22,32,12,33

    18 Give example and applications of directed and undirected graphs. Find theadjacency matrix for the graph shown in figure below

    19 Construct binary search tree for the following data10,3,15,22,6,45,65,23,78,34,5 Find its inorder, preorder and postorder travesal

    20 Construct a tree for the given inorder and postorder traversalsInorder DGBAHEICF

    Postorder GDBHIEFCA21 Define following terms related to tree with example(1) Binary tree(2) Binary search tree(3) Strictly binary tree(4) Complete binary tree

    22 Define the following terms:Path, Cycle, Degree of the vertex, Sibling

  • 8/10/2019 Ds Questionbank

    4/6

    23Create a Binary Search Tree for the following data and do Inorder, Preorder andPostorder traversal of the tree.40, 65,25, 55, 10,70,30,50,15,80,75

    24

    Explain matrix and linked list representation of a Graph. Also compare BFS and DFSmethods of Graph Traversal25 Trace procedure to convert following forest into binary tree

    26 Explain DFS traversal of Graph using example.

    27 Write a short note on Weight balanced tree.28 Insert 1, 29, 32 and 13 in the following Height balanced tree. For each

    insertion, draw the balanced tree using AVL rotation.

    29 Write a short note on Weight balanced tree.30 Answer the following for the below given Graph.

    a) What is the outdegree of node B.b) Write down a path from node D to node A.c). Is the above graph a multigraph? Give a reason for your answer.d)What is the total degree of node A.

  • 8/10/2019 Ds Questionbank

    5/6

  • 8/10/2019 Ds Questionbank

    6/6