0% found this document useful (0 votes)
37 views3 pages

DS Bits

Data Structure objective questions

Uploaded by

abhirampalle954
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)
37 views3 pages

DS Bits

Data Structure objective questions

Uploaded by

abhirampalle954
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/ 3

DATA STRUCTURES

S.No Choose the correct alternative answer for the following question

1. Which of the following points is/are true about Linked List data structure when [ D ]
it is compared with array
(a)Arrays have better cache locality that can make them better in terms of
performance.
(b) It is easy to insert and delete elements in Linked List
(c) Random access is not allowed in a typical implementation of Linked Lists
(d) All of the above
2. In the worst case, the number of comparisons needed to search a singly linked [ D ]
list of length n for a given element is
(a) log 2 n (b) n/2
(c) log 2 n – 1 (d) n
3. The following postfix expression with single digit operands is evaluated using a [ A ]
stack:
823^/23*+51*-
Note that ^ is the exponentiation operator. The top two elements of the stack after
the first * is evaluated are:
(a) 6,1 (b) 5,7
(c) 3,2 (d) 1,5
4. Minimum number of fields in each node of a doubly linked list is ________. [ B ]
(a) 2 (b) 3
(c) 4 (d) None
5. What is a hash table? [ B ]
(a)A structure that maps values to keys
(b) A structure that maps keys to values
(c) A structure used for storage
(d) A structure used to implement stack and queue
6. If several elements are competing for the same bucket in the hash table, what is [ C ]
it called?
(a) Diffusion (b) Replication
(c) Collision (d) None
7. The nodes in a skip list may have many forward references. their number is [ A ]
determined
(a)probabilistically (b) randomly
(c)orthogonally (d) sequentially
8. What is the hash function used in Double Hashing? [ C ]
(a)(h1(k) – i*h2(k))mod m (b) h1(k) + h2(k)
(c) (h1(k) + i*h2(k))mod m (d) (h1(k) + h2(k))mod m
9. How many children does a binary tree have? [ C ]
(a) 2 (b) any number
(c) 0 or 1 or 2 (d) 0 or 1
10. The number of edges from the root to the node is called __________ of the tree. [ C ]
(a) Height (b) Depth
(c) Length (d) Width

11 Which of the following data structure can’t store the non-homogeneous data [ A ]
elements?
(a) Arrays (b) Records
(c) Pointers (d) Stacks
12. What is the output of following function for start pointing to first node of [ D ]
following linked list?
1->2->3->4->5->6
void fun(struct node* start)
{
if(start == NULL)
return;
printf("%d ", start->data);
if(start->next != NULL )
fun(start->next->next);
printf("%d ", start->data);
}
(a) 1 4 6 6 4 1 (b) 1 3 5 1 3 5
(c) 1 2 3 5 (d) 1 3 5 5 3 1
13. Which one of the following is an application of Stack Data Structure? [ D ]
(a)Managing function calls (b) The expression conversion
(c) Arithmetic expression evaluation (d) All of the above
14. . ……… form of access is used to add and remove nodes from a queue. [ B ]
(a) LIFO, Last In First Out (b) FIFO, First In First Out
(c) Both a and b (d) None of the above
15. Which of the following is the efficient data structure for searching words in [ D ]
dictionaries?
(a) BST (b) Linked List
(c) Balanced BST (d) Trie
16. What is a hash function? [ B ]
(a)A function has allocated memory to keys
(b)A function that computes the location of the key in the array
(c) A function that creates an array
(d) None of the mentioned
17. What is the hash function used in the division method? [ B ]
(a) h(k) = k/m (b) h(k) = k mod m
(c) h(k) = m/k (d) h(k) = m mod k

18. Which of the following is not a collision resolution technique? [ D ]


(a) Separate chaining (b) Linear probing
(c) Quadratic probing (d) Extendible hashing
19. To represent hierarchical relationship between elements, Which data structure is [ C ]
suitable?
(a) Queue (b) Stack
(c) Tree (d) Graph
20. If binary trees are represented in arrays, what formula can be used to locate a left [ A ]
child, if the parent node has an index i?
(a) 2i+1 (b) 2i+2
(c) i+1 (d) i+2
Fill in the blanks

1 …TREE ………..is non-liner data structure.


2 Each node in a Binary Search Tree has …… ZERO, ONE, OR TWO…….. children.
3 The height of the binary search tree for the words banana, peach, apple,
pear,coconut,mango,papaya using alphabetical order is: ………5……
4 ……LINKED LIST NODE.…… is identical to that of a separate chaining hash node.
5 A block of memory can be requested at run time using… DYNAMIC MEMORY
ALLOCATION……………
6 ………LINEAR PROBING.……… is not a collision resolution technique.
7 A Single linked list has ……ONE POINTER…… pointers in each node
8 A hash function f defined as f(key) = key mod 7, with linear probing insert the keys
37,38,72,48,98,11,56 into a table indexed from 0 , in which location the key 11 will be
stored (count table index 0 as 0 th location)? …… 5……..
9 ……HASHING…….. is the problem of finding an appropriate mapping of keys into
addresses(i.e., index location)
10 New nodes are added to the .... REAR..... of the queue
11 If the linked list is empty the value of the head node is equals to …… NULL……..
12 ………CHAINING…….. is the best technique to handle collision.
13. If several elements are competing for the same bucket in the hash table, what is it called?
………COLLISION.………….
14. The prefix form of A-B/ (C * D ^ E) is?…… -A/B*C^DE…………...
15.
16. …INSERTION & DELETION.…….. are the two operations are done in a hash table.
17. A linkedlist that allows faster search within an ordered sequence is …SINGLY LINKED
LIST………..
18. Convert the following infix expressions into its equivalent postfix expressions (A + B *
D)/(E – F)+G ..... ABD∗+EF−/G+............
19. Traversing means ……visiting each element in a data structure in a specified order….
20. A …TREE ……. is a kind of data structure that is used to represent the data in hierarchical
form.
21 A data structure in which the last node connects back to the first, forming a loop is called
…CIRCULAR LINKED LIST………

You might also like