Data Structure Quiz 1

Question 1

Time: 00:00:00
What is the worst case time complexity to sort an array which contains only three values 3,4 and 5 ?

O(nlogn)

O(nlogn)

O(n)

O(n)

O(n^{2})

O(n^{2})

O(1)

O(1)

Question 2

Time: 00:00:00
What is the worst case time complexity to find if there is any duplicate element or not if the values of the element is less than the 2*n where n is the size of the array.?

O(1)

O(1)

O(n)

O(n)

O(nlogn)

O(nlogn)

O(n^{2})

O(n^{2})

Question 3

Time: 00:00:00
In breadth first search of graph , which data structure is used.?

Stack

Stack

Queue

Queue

Array

Array

Linked list

Linked list

Question 4

Time: 00:00:00
If the numbers 4,3,2,1 are placed in a queue(in that order) and then removed one at a time. In what order they will be removed ?

1,2,3,4

1,2,3,4

4,3,2,1

4,3,2,1

1,2,4,3

1,2,4,3

4,3,1,2

4,3,1,2

Question 5

Time: 00:00:00
Suppose the numbers 1,2,3,4,5 and 6 arrive in an input stream in that order. Which of the following sequences can be realized as the output of a double ended queue ?
I)1 2 3 4 5 6
II)2 4 3 6 5 1
III)6 5 4 3 2 1
IV)1 5 2 4 3 6

I only

I only

I , II, III and IV

I , II, III and IV

II and IV only

II and IV only

I , III only

I , III only

Question 6

Time: 00:00:00
In an empty queue, rear and front can be initialized as

Rear = front = -1

Rear = front = -1

Rear = front = 1

Rear = front = 1

Rear = 0 and front = -1

Rear = 0 and front = -1

Rear = -1 and front = 0

Rear = -1 and front = 0

Question 7

Time: 00:00:00
Which type of list is used if we can concatenate two list in O(1) time ?

Singly linked list

Singly linked list

Doubly linked list

Doubly linked list

Circular doubly linked list

Circular doubly linked list

Array implementation of list

Array implementation of list

Question 8

Time: 00:00:00
Which data structure satisfies the following characteristics ?

  • Items are retrieved and removed from the collection in FIFO order


  • There is no prior limit on the number of items in the collection.


  • The size of an item is large relative to the storage required for a memory address.




Singly linked list with head and tail pointers

Singly linked list with head and tail pointers

Doubly linked list with only head pointer

Doubly linked list with only head pointer

Binary tree

Binary tree

Hash table

Hash table

Question 9

Time: 00:00:00
If we have a single pointer to a node and there is no pointer to head then is it possible to delete that node ?

Possible if size of linked list is even

Possible if size of linked list is even

Possible if size of linked list is odd

Possible if size of linked list is odd

Possible if x is not first node

Possible if x is not first node

Possible if x is not last node

Possible if x is not last node

Question 10

Time: 00:00:00
How much pointer is modified when we insert a record in a circular linked list ?

No pointer

No pointer

1 pointer

1 pointer

2 pointer

2 pointer

3 pointer

3 pointer

null
null