Explore topic-wise MCQs in Data Structures and Algorithms.

This section includes 16 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.

1.

In the above question would using arrays and swaping of elements in place of xor linked list would have been more efficient ?

A. no not all
B. yes arrays would have been better than xor lists
C. both would be same in efficiency
D. can't say
Answer» C. both would be same in efficiency
2.

What is indexed skip list?

A. it stores width of link in place of element
B. it stores index values
C. array based linked list
D. indexed tree
Answer» B. it stores index values
3.

Given 10,8,6,7,9swap the above numbers such that finally you got 6,7,8,9,10so now reverse 109,7,6,8,10now reverse 98,6,7,9,107,6,8,9,106,7,8,9,10at this point 6 is ahead so no more reversing can be done so stop.To implement above algorithm which datastructure is better and why ?

A. linked list. because we can swap elements easily
B. arrays. because we can swap elements easily
C. xor linked list. because there is no overhead of pointers and so memory is saved
D. doubly linked list. because you can traverse back and forth
Answer» D. doubly linked list. because you can traverse back and forth
4.

Is a skip list like balanced tree?

A. true
B. false
Answer» B. false
5.

The self organizing list improves the efficiency of _______

A. binary search
B. jump search
C. sublist search
D. linear search
Answer» E.
6.

What technique is used in Transpose method?

A. searched node is swapped with its predecessor
B. node with highest access count is moved to head of the list
C. searched node is swapped with the head of list
D. searched nodes are rearranged based on their proximity to the head node
Answer» B. node with highest access count is moved to head of the list
7.

The worst case running time of a linear search on the self organizing list is ____

A. O(1)
B. O(logn)
C. O(n)
D. O(n2)
Answer» D. O(n2)
8.

Which of the following method performs poorly when elements are accessed in sequential order?

A. count method
B. move to front method
C. transpose meth
D. ordering method
Answer» C. transpose meth
9.

Which of the following data structure is preferred to have lesser search time when the list size is small?

A. search tree
B. sorted list
C. self organizing list
D. linked list
Answer» D. linked list
10.

Which of the following statements are true ?i) practical application of XOR linked lists are in environments with limited space requirements, such as embedded devices.ii)xor lists are not suitable because most garbage collectors will fail to work properly with classes or structures that don't contain literal pointersiii)in order to calculate the address of the next node you need to remember the address of the previous nodeiv)xor lists are much efficient than single, doubly linked lists and arrays

A. i, ii, iii, iv
B. i, ii, iii
C. i, ii
D. i
Answer» C. i, ii
11.

Which of the following is true about the Move-To-Front Method for rearranging nodes?

A. node with highest access count is moved to head of the list
B. requires extra storage
C. may over-reward infrequently accessed nodes
D. requires a counter for each node
Answer» D. requires a counter for each node
12.

Symbol tables during compilation of program is efficiently implemented using __________

A. a singly linked list
B. a doubly linked list
C. a self organizing list
D. an array
Answer» D. an array
13.

Which of the following is not the rearranging method used to implement self-organizing lists?

A. count method
B. move to front method
C. ordering method
D. least frequently used
Answer» E.
14.

Are the below statements true about skiplists? In a sorted set of elements skip lists can implement the below operations i.given a element find closest element to the given value in the sorted set in O(logn) ii.find the number of elements in the set whose values fall a given range in O(logn)

A. true
B. false
Answer» B. false
15.

The self organizing list improves _____

A. average access time
B. insertion
C. deletion
D. binary search
Answer» B. insertion
16.

In _____________ method, whenever a node is accessed, it might move to the head of the list if its number of accesses becomes greater than the records preceding it.

A. least recently used
B. count
C. traspose
D. exchange
Answer» C. traspose