# Data Structures Previous Year Questions and Answers

The Free download links of Data Structures Previous Year Questions and Answers Papers enclosed below. Candidates who are going to start their preparation for the Data Structures Previous Year papers can use these links. Download the Data Structures Previous Year Papers PDF along with the Answers. Data Structures Previous Year Papers are updated here. A vast number of applicants are browsing on the Internet for the Data Structures Previous Year Question Papers & Syllabus. For those candidates, here we are providing the links for Data Structures Previous Year Papers. Improve your knowledge by referring the Data Structures Previous Year Question papers.

## Previous Year Questions and Answers on Data Structures

1. The variables which can be accessed by all modules in a program, are known as

(a) local variables

(b) internal variables.

(c) external variables

(d) global variable

2. In which kind of storage structure for strings, one can easily insert, delete concatenate and rearrange substrings?

(a) Variable length storage with fixed maximum

(b) Away type storage

(c) Fixed length storage structure

(d) Linked list storage

3. A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far as left as possible, is known as

(a) full binary tree

(b) 2-tree

(c) threaded tree

(d) complete binary tree

4. A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end is known as

(a) Queues

(b) Trees

(c) Stacks

(d) branch

5. Which data structure is needed to convert infix notation to post fix notations?

(a) Branch

(b) Queue

(c) Stack

(d) Tree

6. Which of the following operations is performed more efficiently by doubly linked list than by linear linked list?

(a) Deleting nodes whose location is given.

(b) Searching an unsorted list for a given item.

(c) Inserting a node after the node with a given location.

(d) Traversing the list to process each node.

7. Which of the following sorting procedure is the slowest ?

(a) Quick sort

(b) Stell sort

(c) Heap sort

(d) Bubble sort

8. A stack is linear data structure in which data is stored and retrieved in a

(a) Last out First in (LOFI)

(b) Last in First out (LIFO)

(c) First in First out (FIFO)

(d) Last out Last in (LOLI)

9. The smallest element of an array’s index is called its

(a) Lower bound

(b) Range

(c) Upper bound

(d) Extraction

10. The post fix form A+ (B* C) is

(a) ABC+*

(b) AB+C*

(c) ABC * +

(d) AB*C+

11. The post fix form of (A + B) *C is

(a) AB + C*

(b) ABC* C+

(c) ABC* +

(d) ABC+*

12. The post fix form of A & B *C-D+E/F/(G+ H) is

(a) AB $ C*D – EF/GH +/+

(b) AB $ C + D – EF/GH/-+

(c) AB $ * C – D + EF/GH/ +

(d) AB $ C – D * EF /GH/ ++

13. The post fix form of A-B/(C* D $ E) is

(a) ABCDE $*/-

(b) ABCDE $-/*

(c) AB/C* DE $

(d) ABCDE/-*$

14. The prefix form of A-B/(C*D $ E) is

(a) -1* $ ACBDE

(b) -A/B*C $ DE

(c) – ABC D* $ DE

(d) – A/BC*$ DE

(e) (b) * +- ABCD

(f) (d) * AB + CD

15. The prefix of (A + B)*(C-D) is

(a) +- AB*(C-D)

(b) * + AB-CD

(c) * +- ABCD

(d) * AB + CD

16. What is the post fix form of the following prefix -A/B *C $ DE

(a) ABCDE $*/-

(b) ABC*ED* /

(c) A-BCDE $*/-

(d) A-BCDE-*$

17. What is the post fix form of the following prefix *+AB-CD

(a) AB+CD-*

(b) AB+* CD-

(c) ABC+*-

(d) AB+*CD-

18. The Fibonacci sequence is the sequence of integers

(a) 1, 3, 5, 7, 9, 11, 13

(b) 0, 1, 1, 2, 3, 5, 8, 13, 21, 54….

(c) 0, 1, 3, 4, 7, 11, 18, 29, 47…

(d) 0, 1, 3, 7, 15…

19. A sort which uses the binary tree concept such that any number is larger than all the numbers in the subtree below it is called

(a) Selection sort

(b) Heap sort

(c) Insertion sort

(d) Quick sort

20. A full binary tree with n non-leaf nodes contains

(a) \log _{2}n nodes

(b) 2n nodes

(c) n + 1 nodes

(d) 2n + 1 nodes

Practice Question | Objective Papers |

Quiz | Important Papers |

Mock Tests | Previous Papers |

Typical Question | Sample Question |

MCQs | Model Papers |

21. A full binary tree with n leaves contains

(a) n nodes

(b) 2n-1 nodes

(c) \log _{2}n nodes

(d) 2n nodes

22. A sort which relatively passes through a list to exchange the first element with any element less than it and then repeats with a new first element is called

(a) Insertion sort

(b) Heap sort

(c) Selection sort

(d) Quick sort

23. A sort which compares adjacent elements in a list and switches where necessary is a

(a) Insertion sort

(b) Heap sort

(c) Bubble sort

(d) Quick sort

24. A characteristic of the data that binary searches uses but the linear search ignores is the

(a) order of the list

(b) length of the list

(c) maximum value of the list

(d) mean of data values

25. Which of the following sort method is stable?

(a) Straight insertion sort

(b) Shell sort

(c) Binary insertion sort

(d) Heap sort

26. A graph G with n nodes is biparatite, if it contains

(a) n edges

(b) no cycle of odd length

(c) a cycle of odd length

(d) n² edges

27. The C declaration

int b [100];

reserves ___________ successive memory locations, each large enough to contain single integer.

(a) 200

(b) 100

(c) 10,000

(d) 10

28. The C declaration

int A[3] [5] j

Containing ___________ element, each of those elements is itself an array containing _________ integers.

(a) 3,5

(b) 3,3

(c) 5,3

(d) 5,5

29. This declaration

Struct {

char first [10];

char midinit;

char last [20];

} s name, ename;

Creates ____________ structure variables, each of which contains _______ members.

(a) 3,2

(b) 3,3

(c) 2,3

(d) 6,6

30. A search procedure which associates an address with a key value and provides a mechanism for dealing with two or more values assigned to the same address is called

(a) linear search

(b) Hash coded search

(c) binary search

(d) radix search

31. If each node in a tree has value greater than every value in its left subtree and has value less than every value in its right subtree, the tree is known as

(a) Complete tree

(b) Binary search tree

(c) Full binary tree

(d) Threaded tree

32. Recursive procedures are implemented by

(a) Queues

(b) linked list

(c) stacks

(d) strings

33. The post fix form of the following infix (A + B) * (C+D-E) * F is

(a) AB+CD+E-*F*

(b) AB+CD-EF+-**

(c) AB + CDE +-*F*

(d) ABCDEF*-+*+

34. An _____________ is a collection of items into which items can be inserted arbitrarity and from which only the smallest item can be removed.

(a) descending priority queue

(b) fifo queue

(c) ascending priority queue

(d) lifo queue

35. In C a pointer variable to an integer can be created by the declaration

(a) int p*

(b) int * p

(c) int-p;

(d) int $p;

36. Which of the following sorting algorithm has a worst case running time of 0 (nr where 1<r<2)?

(a) Bubble sort

(b) Shell sort

(c) Insertion sort

(d) Merge sort

37. Which of the following sorting algorithms does not have a worst case running time of 0 (n²) ?

(a) Insertion sort

(b) Merge sort

(c) Quick sort

(d) Bubble sort

38. In which of the following sorting algorithm, the number of comparisons needed is the minimum if the items are initially in reverse order and is the maximum if the items are in order

(a) Straight insertion sort

(b) Heap sort

(c) Binary insertion sort

(d) Bubble sort

39. In what tree, for every node the height of its left subtree and right subtree differ at least by one

(a) Binary search tree

(b) AVL-tree

(c) Complete tree

(d) Threaded binary tree

40. An undirected graph G with n vertices and e edges is represented by Adjacency matrix. What is the time required to determine the in-degree of a vertex?

(a) 0 (e)

(b) 0 (n²)

(c) 0 (n)

(d) 0 (e + n)

41. A undirected graph G with n vertices and e edges is represented by adjacency list. What is the time required to generate all the connected components?

(a) 0(n)

(b) 0 (e + n)

(c) 0 (e)

(d) 0 (e²)

42. A undirected graph with n vertices and e edges are represented by Adjacency matrix. What is the time required to determine whether the graph is connected?

(a) 0 (e)

(b) 0 (n²)

(c) 0 (n)

(d) 0 (e + n)

43. In what order the elements of a pushdown stack are accessed?

(a) First In First Out (FIFO)

(b) Last In First Out (LIFO)

(c) Last In Last Out (LILO)

(d) All of the above

44. A list of data items, usually words or bytes, with the accessing restriction that elements can be added or removed at one end of the list only, is known as

(a) Stack

(b) Linked list

(c) Memory

(d) Heap

45. Consider that n elements are to be sorted. What is the worst case time complexity of shell sort?

(a) 0 (n)

(b) 0 (n^{1.2})

(c) 0 (n \log _{2}n)

(d) 0 (n²)

46. Consider that n elements are to be sorted. What is the worst case time complexity of Bubble sort ?

(a) 0 (1)

(b) 0 (\log _{2}n)

(c) 0 (n²)

(d) 0(n)

47. Consider a linked list of n elements. What is the time taken to insert an element after an element pointed by some pointer ?

(a) 0 (1)

(b) 0 (n)

(c) 0 (\log _{2}n)

(d) 0 (n \log _{2}n)

48. The extra key inserted at the end of the array is called a

(a) end key

(b) sentinel

(c) stop key

(d) transposition

49. A complete binary tree with the property that the value at each node is at least as large as the values at its children is known as

(a) Binary search tree

(b) Completely balanced tree

(c) AVL tree

(d) Heap

50. The following C declarations

Struct node {

int i;

Float j;

};

Struct node* s [10];

define s to be

(a) An array, each element of which is a pointer to a structure.

(b) A structure of 2 fields, each field being a pointer to an array of 10 elements.

(c) A structure of 3 fields; an integer, a float, and an array of 10 elements.

(d) An array, each element of which is a structure of type node.

51. A liaising in the context of programming languages refers to

(a) Multiple variables having the same memory location

(b) Multiple variables having the same value

(c) Multiple variables having the same identifies

(d) Multiple uses of the same variable.

52. Consider the following C declaration

Struct {

Short S [5]:

Union {

Float y;

long z;

} u;

} t;

Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes respectively. The memory equipment for variable t, ignoring alignment considerations, is

(a) 22 bytes

(b) 14 bytes

(c) 18 bytes

(d) 10 bytes

53. The number of tokens in the following C statements

print f( “i=%d; & i=%x”, i, & i); is

(a) 3

(b) 10

(c) 26

(d) 21

33. The value of j at the end of the execution of the following C program

int incr (int i)

{

Static int Count = 0;

Count Count + i;

return (Count);

}

main () {

int i, j;

for (i=0; i≤4; i++)

j= incr (i); } is

(a) 10

(b) 6

(c) 4

(d) 7

54. Consider the following C function definition

int Trial (int a, int b, int c).

{

if ((a>= b) && (c<b) return b;

else if (a>= b) return Trial (a, c, b);

else return Trial (b, a, c);

else return Trial (b, a, c);

}

the function. Trial

Finds the

(a) maximum of a, b and c

(b) minimum of a, b, and c.

(c) middle number of a, b, and c

(d) None of the above

55. What value would the following function return for the input x=95?

Function (x: integer): integer;

Begin

If x 100 then fun:-x-10

else fun:= fun (fun (x +11))

end,

(a) 89

(b) 91

(c) 90

(d) 92

56. What is the result of the following program?

program side effect (input, output);

var x, result: integer:

function f (var x : integer): integer;

begin

x :=x + 1;

f: = x;

end

begin

x : = 5

result: = f(x) * f(x);

write In (result);

end

(a) 5

(b) 36

(c) 25

(d) 42

57. In the following pascal program segment, what is the value of x after the execution of the program segment.

x := -10; y := 20;

If x>y then if x<0 then x:= abs(x) else x := 2* x;

(a) 10

(b) 10

(c) – 20

(d) None of the above