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

S.Y.-B.Sc_.-III_Data-Structure-I

Very important
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)
33 views

S.Y.-B.Sc_.-III_Data-Structure-I

Very important
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/ 18

Arts, Commerce and Science College, Bodwad.

Question Bank
S.Y. B.Sc. Sem-III Subject: - Data structure
---------------------------------------------------------------------------------------------------------------
Multiple Choice Questions

1.How is Data in a queue accessed

A. First in First out


B. First in last out
C. Last in First out
D. None of these

2.Item in priority queue can jump to the front on the line if they have priority

A TRUE
B FALSE
C None of these

3.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 (rear) is known as a

A queue.
B stack.
C tree.
D linked list.

4. The data structure required for Breadth First Traversal on a graph is

A queue
B stack
C array
D tree

5.A queue is a,

A FIFO (First In First Out) list.


B LIFO (Last In First Out) list.
C Ordered array.
D Linear tree.
6.The following data structure allows deleting data elements from front and inserting
at rear

A Stacks
B Queues
C Deques
D Binary search tree

7.This data structure allows deletions at both ends of the list but insertion at only one
end.

A Input-restricted deque
B Output-restricted deque
C Priority queues
D None of the above

8.Convert the infix to postfix for A-(B+C)*(D/E)

A. ABC+DE/*-
B. ABC-DE/*-
C ABC-DE*/-
D. None of the above

9.The data structure required to evaluate a postfix expression is

A queue
B stack
C array
D linked-list

10.The data structure required to check whether an expression contains balanced


parenthesis is

A Stack
B Queue
C Tree
D Array
11.The process of accessing data stored in a serial access memory is similar to
manipulating data on a

A heap
B queue
C stack
D binary tree

12.The postfix form of the expression is (A+B) * (C*D-E)*F/G is

A AB+CD*E-FG/**
B. AB+CD*E-*F*G/
C. AB+CD*E-F**G/
D. AB+CDE*-*F*G/

13.What data structure would you mostly likely see in a nonrecursive implementation
of a recursive algorithm?

A Stack
B Linked list
C Queue
D Trees

14.Which data structure is needed to convert infix notation to postfix notation?

A Branch
B Queue
C Tree
D stack

15.Which data structure is used for implementing recursion?

A Queue.
B Stack.
C Arrays.
D List.

16.The term "push" and "pop" is related to the


A Array
B Lists
C stacks
D all of above

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

A +-AB*(C-D)
B * +-ABCD
C * +AB-CD
D *AB+ CD

18.A linear collection of data elements where the linear node is given by means of
pointer is called?
a) Linked list
b) Node list
c) Primitive list
d) Unordered list
Answer: a

19 In linked list each node contain minimum of two fields. One field is data field to
store the data second field is?
a) Pointer to character
b) Pointer to integer
c) Pointer to node
d) Node
Answer: c

20 What would be the asymptotic time complexity to add a node at the end of singly
linked list, if the pointer is initially pointing to the head of the list?
a) O(1)
b) O(n)
c) θ(n)
d) θ(1)

Answer: c

21 The concatenation of two list can performed in O(1) time. Which of the following
variation of linked list can be used?
a) Singly linked list
b) Doubly linked list
c) Circular doubly linked list
d) Array implementation of list
Answer: c

22. What differentiates a circular linked list from a normal linked list?
a) You cannot have the ‘next’ pointer point to null in a circular linked list
b) It is faster to traverse the circular linked list
c) You may or may not have the ‘next’ pointer point to null in a circular linked list
d) Head node is known in circular linked list
Answer: c

23.What is the time complexity of searching for an element in a circular linked list?
a) O(n)
b) O(nlogn)
c) O(1)
d) O(n2)
Answer: a

24.Which of the following application makes use of a circular linked list?


a) Undo operation in a text editor
b) Recursive function calls
c) Allocating CPU to resources
d) Implement Hash Tables

Answer: c

25.Process of inserting an element in stack is called ____________


a) Create
b) Push
c) Evaluation
d) Pop
Answer: b

26.Process of removing an element from stack is called __________


a) Create
b) Push
c) Evaluation
d) Pop
Answer: d

27In a stack, if a user tries to remove an element from empty stack it is called
_________
a) Underflow
b) Empty collection
c) Overflow
d) Garbage Collection

Answer: a

28 Pushing an element into stack already having five elements and stack size of 5,
then stack becomes
a) Overflow
b) Crash
c) Underflow
d) User flow

Answer: a

29Entries in a stack are “ordered”. What is the meaning of this statement?


a) A collection of stacks is sortable
b) Stack entries may be compared with the ‘<‘ operation
c) The entries are stored in a linked list
d) There is a Sequential entry that is one by one

Answer: d

30 Which of the following is not the application of stack?


a) A parentheses balancing program
b) Tracking of local variables at run time
c) Compiler Syntax Analyzer
d) Data Transfer between two asynchronous process

Answer: d

31 Consider the usual algorithm for determining whether a sequence of parentheses


is balanced.
The maximum number of parentheses that appear on the stack AT ANY ONE TIME
when the algorithm analyzes: (()(())(())) are:
a) 1
b) 2
c) 3
d) 4 or more

Answer: c

32 What is the value of the postfix expression 6 3 2 4 + – *?


a) 1
b) 40
c) 74
d) -18

Answer: d

33The data structure required to check whether an expression contains balanced


parenthesis is?
a) Stack
b) Queue
c) Array
d) Tree

Answer: a

34The process of accessing data stored in a serial access memory is similar to


manipulating data on a ________
a) Heap
b) Binary Tree
c) Array
d) Stack
Answer: d

35.What is the result of the following operation?


Top (Push (S, X))
a) X
b) X+S
c) S
d) XS

Answer: a

36.The prefix form of an infix expression (p + q) – (r * t) is?


a) + pq – *rt
b) – +pqr * t
c) – +pq * rt
d) – + * pqrt
Answer: c

37 Which data structure is used for implementing recursion?


a) Queue
b) Stack
c) Array
d) List
Answer: b

38 In a circular queue, how do you increment the rear end of the queue?
a) rear++
b) (rear+1) % CAPACITY
c) (rear % CAPACITY)+1
d) rear–

Answer: b

39.What is the term for inserting into a full queue known as?
a) overflow
b) underflow
c) null pointer exception
d) program won’t be compiled

Answer: a

40.What is the need for a circular queue?


a) effective usage of memory
b) easier computations
c) to delete elements based on priority
d) implement LIFO principle in queues
Answer: a

41 With what data structure can a priority queue be implemented?


a) Array
b) List
c) Heap
d) Tree
Answer: d

42 Which of the following is not an application of priority queue?


a) Huffman codes
b) Interrupt handling in operating system
c) Undo operation in text editors
d) Bayesian spam filter

Answer: c

43 What is the time complexity to insert a node based on key in a priority queue?
a) O(nlogn)
b) O(logn)
c) O(n)
d) O(n2)

Answer: c

44 What is a dequeue?
a) A queue with insert/delete defined for both front and rear ends of the queue
b) A queue implemented with a doubly linked list
c) A queue implemented with both singly and doubly linked lists
d) A queue with insert/delete defined for front side of the queue

Answer: a

45 What are the applications of dequeue?


a) A-Steal job scheduling algorithm
b) Can be used as both stack and queue
c) To find the maximum of all sub arrays of size k
d) To avoid collision in hash tables

Answer: d

46 What is the time complexity of deleting from the rear end of the dequeue
implemented with a singly linked list?
a) O(nlogn)
b) O(logn)
c) O(n)
d) O(n2)
Answer: c

47 Which of the following is false about a doubly linked list?


a) We can navigate in both the directions
b) It requires more space than a singly linked list
c) The insertion and deletion of a node take a bit longer
d) Implementing a doubly linked list is easier than singly linked list

Answer: d

48 What is a memory efficient double linked list?


a) Each node has only one pointer to traverse the list back and forth
b) The list has breakpoints for faster traversal
c) An auxiliary singly linked list acts as a helper list to traverse through the doubly
linked list
d) A doubly linked list that uses bitwise AND operator for storing addresses

Answer: a
49 How do you calculate the pointer difference in a memory efficient double linked
list?
a) head xor tail
b) pointer to previous node xor pointer to next node
c) pointer to previous node – pointer to next node
d) pointer to next node – pointer to previous node

Answer: b

50 What is the worst case time complexity of inserting a node in a doubly linked list?
a) O(nlogn)
b) O(logn)
c) O(n)
d) O(1)

Answer: c

51.Why is implementation of stack operations on queues not feasible for a large


dataset (Asssume the number of elements in the stack to be n)?
a) Because of its time complexity O(n)
b) Because of its time complexity O(log(n))
c) Extra memory is not required
d) There are no problems
Answer: a

52 Given only a single array of size 10 and no other memory is available. Which of
the following operation is not feasible to implement (Given only push and pop
operation)?
a) Push
b) Pop
c) Enqueue
d) Returntop
Answer: c

53 Given pointer to a node X in a singly linked list. Only one pointer is given, pointer
to head node is not given, can we delete the node X from given linked list?
a) Possible if X is not last node
b) Possible if size of linked list is even
c) Possible if size of linked list is odd
d) Possible if X is not first node
Answer: a
54 You are given pointers to first and last nodes of a singly linked list, which of the
following operations are dependent on the length of the linked list?
a) Delete the first element
b) Insert a new element as a first element
c) Delete the last element of the list
d) Add a new element at the end of the list
Answer: c

55. Which of these best describes an array?


a) A data structure that shows a hierarchical behaviour
b) Container of objects of similar types
c) Arrays are immutable once initialised
d) Array is not a data structure
Answer: b

56 How do you initialize an array in C?


a) int arr[3] = (1,2,3);
b) int arr(3) = {1,2,3};
c) int arr[3] = {1,2,3};
d) int arr(3) = (1,2,3);

Answer: c

57 Which of the following concepts make extensive use of arrays?


a) Binary trees
b) Scheduling of processes
c) Caching
d) Spatial locality
Answer: d

58 Assuming int is of 4bytes, what is the size of int arr[15];?


a) 15
b) 19
c) 11
d) 60

Answer: d

59 In general, the index of the first element in an array is __________


a) 0
b) -1
c) 2
d) 1
Answer: a
60 Elements in an array are accessed _____________
a) randomly
b) sequentially
c) exponentially
d) logarithmically

Answer: a

61 A binary search tree whose left subtree and right subtree differ in hight by at most
1 unit is called .....
[A] Lemma tree
[B] Redblack tree
[C] AVL tree
[D] None of the above
Answer c

62 Which of the following is non-linear data structure?


[A] Trees
[B] Stacks
[C] Strings
[D] All of the above

Answer: a

63 The number of comparisons done by sequential search is .......


[A] (N/2)+1
[B] (N+1)/2
[C] (N-1)/2
[D] (N-2)/2
Answer: Option [B]

64 .... is not the operation that can be performed on queue.


[A] Traversal
[B] Insertion
[C] Deletion
[D] Retrieval
Answer: Option [A]

65 Which is/are the application(s) of stack


[A] Function calls
[B] Large number Arithmetic
[C] Evaluation of arithmetic expressions
[D] All of the above
Answer: Option [D]

66 Which of the following data structures are indexed structures?


[A] Stack
[B] Linked lists
[C] Linear arrays
[D] None of the above
Answer: Option [C]

67Which of the following data structure store the homogeneous data elements?
[A] Lists
[B] Pointers
[C] Records
[D] Arrays
Answer: Option [C]

68 Linear arrays are also called.......


[A] One-dimensional array
[B] Vertical array
[C] Horizontal array
[D] All of the above
Answer: Option [A]

69 A ......... does not keep track of address of every element in the list.
[A] Stack
[B] Queue
[C] String
[D] Linear array

Answer: Option [D]

70 The complexity of linear search algorithm is


[A] O(n)
[B] O(log n)
[C] O(n2)
[D] O(n log n)
Answer: Option [A]

71 The complexity of Binary search algorithm is


[A] O(n)
[B] O(log n)
[C] O(n2)
[D] O(n log n)
Answer: Option [B]
72Linear arrays are also called.......
[A] One-dimensional array
[B] Vertical array
[C] Horizontal array
[D] All of the above
Answer: Option [A]

73Can linked list be implemented using arrays?


A. Yes
B. No
Ans: A

74 Two dimensional arrays are also called


A. tables arrays
B. matrix arrays
C. both of above
D. none of above
Ans: C

75 Can stack be described as a pointer?


A. Yes
B. No
Ans: A

76 Which of the following linked list below have last node of the list pointing to the
first node?
A. circular doubly linked list
B. circular linked list
C. circular singly linked list
D. doubly linked list
Ans: A

77 Items in a priority queue are entered in a _____________ order


A. random
B. order of priority
C. as and when they come
D. none of the above
Ans: A

78An empty list is the one which has no


A. nodes
B. data
C. both a and b above
D. address
Ans: C

79. Which data structure allows deleting data elements from front and inserting at
rear?
a. Stacks
b. Queues
c. Deques
d. Binary search tree
ans:b

80 Identify the data structure which allows deletions at both ends of the list but
insertion at only one end.
a. Input-restricted deque
b. Output-restricted deque
c. Priority queues
d. None of above
ans:a

81 Which of the following data structure is non-linear type?


a. Strings
b. Lists
c. Stacks
d. None of above
ans:d

82 Which of the following data structure is linear type?


a. Strings
b. Lists
c. Queues
d. All of above
ans:d

83 To represent hierarchical relationship between elements, which data structure is


suitable?
a. Deque
b. Priority
c. Tree
d. All of above
ans: c

84In linked lists there are noNULL links in:


a. Sin gle linked list
b. Lin ear dou bly linked list
c. cir cu lar linked list
d. None of the above
ANS:C

85 In a Stack the com mand to access nth ele ment from the top of the stack s will be
a. S[Top-n]
b. S [Top+n]
c. S [top-n-1]
d. None of the above
ANS:A

86 The result of eval u at ing pre fix expres sion */b+-dacd, where a = 3, b = 6, c = 1,
d = 5 is
a. 0
b. 5
c. 10
d. 15
ANS:C

87Two main measures for the efficiency of an algorithm are


a. Processor and memory
b. Complexity and capacity
c. Time and space
d. Data and space
Ans: c

88The time factor when determining the efficiency of algorithm is measured by


a. Counting microseconds
b. Counting the number of key operations
c. Counting the number of statements
d. Counting the kilobytes of algorithm
Ans:b

89The space factor when determining the efficiency of algorithm is measured by


a. Counting the maximum memory needed by the algorithm
b. Counting the minimum memory needed by the algorithm
c. Counting the average memory needed by the algorithm
d. Counting the maximum disk space needed by the algorithm
Ans:a

90Which of the following case does not exist in complexity theory


a. Best case
b. Worst case
c. Average case
d. Null case
Ans:d

91The complexity of the average case of an algorithm is


a. Much more complicated to analyze than that of worst case
b. Much more simpler to analyze than that of worst case
c. Sometimes more complicated and some other times simpler than that of worst
case
d. None or above
Ans:a

92 Which of the following data structure is not linear data structure?


a. Arrays
b. Linked lists
c. Both of above
d. None of above
Ans:d

93The operation of processing each element in the list is known as


a. Sorting
b. Merging
c. Inserting
d. Traversal
Ans:d

94Finding the location of the element with a given value is:


a. Traversal
b. Search
c. Sort
d. None of above
Ans:b

95Linked lists are best suited


a. for relatively permanent collections of data
b. for the size of the structure and the data in the structure are constantly changing
c. for both of above situation
d. for none of above situation
Ans:b

96 Each array declaration need not give, implicitly or explicitly, the information about
a. the name of array
b. the data type of array
c. the first data from the set to be stored
d. the index set of the array
Ans:c

97 The elements of an array are stored successively in memory cells because


a. by this way computer can keep track only the address of the first element and the
addresses of other elements can be calculated
b. the architecture of computer memory does not allow arrays to store other than
serially
c. both of above
d. none of above
Ans: a

98_______ form of access is used to add and remove nodes from a queue
A. LIFO,Last In First Out
B. FIFO , First In First Out
C. Both 1 and 2
D. None of these
Ans: B

99______ form of access is used to add and remove nodes from a stack
A. LIFO
B. FIFO
C. Both 1 and 2
D. None of these
Ans: A

100 New nodes are added to the _____ of the queue.


A. front
B. back
C. middle
D. Both 1 and 2
Ans: B

You might also like