WorksheetsData Structures Multiple Choice Questions
Total questions: 38
Worksheet time: 22mins
What is a data structure?
A programming language
A collection of algorithms
A way to store and organize data
A type of computer hardware
What are the disadvantages of arrays?
Index value of an array can be negative
Elements are sequentially accessed
Data structure like queue or stack cannot be implemented
There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
Which data structure is used for implementing recursion?
Stack
Queue
List
Array
The data structure required to check whether an expression contains a balanced parenthesis is?
Queue
Stack
Tree
Array
Which of the following is not the application of stack?
Data Transfer between two asynchronous process
Compiler Syntax Analyzer
Tracking of local variables at run time
A parentheses balancing program
Which data structure is needed to convert infix notation to postfix notation?
Tree
Branch
Stack
Queue
What is the value of the postfix expression 6 3 2 4 + – *?
74
-18
22
40
What data structure would you mostly likely see in non recursive implementation of a recursive algorithm?
Stack
Linked List
Tree
Queue
Which of the following statement(s) about stack data structure is/are NOT correct?
Top of the Stack always contain the new node
Stack is the FIFO data structure
Null link is present in the last node at the bottom of the stack
Linked List are used for implementing Stacks
The data structure required for Breadth First Traversal on a graph is?
Array
Stack
Tree
Queue
The prefix form of A-B/ (C * D ^ E) is?
-A/B*C^DE
-A/BC*^DE
-ABCD*^DE
−/ACBDE
Which of the following points is/are not true about Linked List data structure when it is compared with an array?
Random access is not allowed in a typical implementation of Linked Lists
Access of elements in linked list takes less time than compared to arrays
Arrays have better cache locality that can make them better in terms of performance
It is easy to insert and delete elements in Linked List
Which data structure is based on the Last In First Out (LIFO) principle?
Tree
Linked List
Stack
Queue
Which of the following application makes use of a circular linked list?
Recursive function calls
Undo operation in a text editor
Implement Hash Tables
Allocating CPU to resources
What is a bit array?
Data structure that compactly stores bits
Data structure for representing arrays of records
Array in which elements are not present in continuous locations
An array in which most of the elements have the same value
Which of the following tree data structures is not a balanced binary tree?
Splay tree
B-tree
AVL tree
Red-black tree
Which of the following is not the type of queue?
Priority queue
Circular queue
Single ended queue
Ordinary queue
Which of the following data structures can be used for parentheses matching?
n-ary tree
queue
priority queue
stack
Which algorithm is used in the top tree data structure?
Backtracking
Divide and Conquer
Branch
Greedy
What is the need for a circular queue?
easier computations
implement LIFO principle in queues
effective usage of memory
to delete elements based on priority
Which of the following is the most widely used external memory data structure?
B-tree
Red-black tree
AVL tree
Both AVL tree and Red-black tree
Which of the following is also known as Rope data structure?
Linked List
Array
String
Cord
What will be the output of the following program?
a) yrdnuof nas
b) foundry nas
c) sanfoundry
d) san foundry
Which of the following data structure can provide efficient searching of the elements?
What is an AVL tree?
a tree which is unbalanced and is a height balanced tree
a tree which is balanced and is a height balanced tree
a tree with atmost 3 children
a tree with three children
What is the time complexity for searching a key or integer in Van Emde Boas data structure?
O (M!)
O (log M!)
O (log (log M))
O(M2)
The optimal data structure used to solve Tower of Hanoi is _________
Tree
Heap
Priority queue
Stack
What is the use of the bin data structure?
to have efficient traversal
to have efficient region query
to have efficient deletion
to have efficient insertion
Which is the most appropriate data structure for reversing a word?
stack
queue
graph
tree
What is the functionality of the following piece of code? public void display() { if(size == 0) System.out.println("underflow"); else { Node current = first; while(current != null) { System.out.println(current.getEle()); } } } A) It displays all elements in a linked list or prints "underflow" if the list is empty. B) It deletes all elements from a linked list. C) It adds a new element to the end of a linked list. D) It reverses the linked list and prints the elements.
It displays all elements in a linked list or prints "underflow" if the list is empty.
It deletes all elements from a linked list.
It adds a new element to the end of a linked list.
It reverses the linked list and prints the elements.
Which of the following is the simplest data structure that supports range searching?
AA-trees
K-d trees
Heaps
binary search trees
What is the advantage of a hash table as a data structure?
easy to implement
faster access of data
exhibit good locality of reference
very efficient for less number of entries
Which type of data structure is a ternary heap?
Hash
Array
Priority Stack
Priority Queue
What is a dequeue?
A queue implemented with both singly and doubly linked lists
A queue with insert/delete defined for front side of the queue
A queue with insert/delete defined for both front and rear ends of the queue
A queue implemented with a doubly linked list
A data structure in which elements can be inserted or deleted at/from both ends but not in the middle is?
Priority queue
Dequeue
Circular queue
Queue
What is the output of the following Java code? public class array { public static void main(String args[]) { // code not fully visible } } A) Compilation error B) 0 C) null D) Runtime exception
Compilation error
0
null
Runtime exception
Given the following Java code snippet: int []arr = {1,2,3,4,5}; System.out.println(arr[2]); System.out.println(arr[4]); What will be the output?
4 and 2
2 and 4
5 and 3
3 and 5
In simple chaining, what data structure is appropriate?
Doubly linked list
Circular linked list
Singly linked list
Binary trees
