Multiple Choice Questions on Data Structure

 Data Structure Question Bank for Mid Semester Examination

 1. What is the worst-case time for serial search finding a single item in an array?

A. Constant time

B. Quadratic time

C. Logarithmic time

D. Linear time                                                                             [ D ]

 2. What is the worst-case time for binary search finding a single item in an array?

A. Constant time

B. Quadratic time

C. Logarithmic time

D. Linear time                                                                             [ B ]

3. What additional requirement is placed on an array, so that binary search may be used to locate an entry?

A. The array elements must form a heap.

B. The array must have at least 2 entries

C. The array must be sorted.

D. The array's size must be a power of two.                                     [ C ]

 4. Which searching can be performed recursively?

A. linear search

B. both

C. Binary search

D. none                                                                                      [ B ]

 5. Which searching can be performed iteratively?

A. linear search

B. Binary search

C. both

D. none                                                                                      [ C ]

 6. In a selection sort of n elements, how many times is the swap function called in the complete execution of the algorithm?

A. 1

C. n - 1

B. n2

D. nlogn                                                                                     [ B ]

 7. Suppose that a selection sort of 100 items has completed 42 iterations of the main loop. How many items are now guaranteed to be in their final spot (never to be moved again)?

A. 21

B. 41

C. 42

D. 43                                                                                         [ C ]

 8. When is insertion sort a good choice for sorting an array?

A. Each component of the array requires a large amount of memory

B. The array has only a few items out of place

C. Each component of the array requires a small amount of memory

D. The processor speed is fast                                                       [ B ]

 9. In which searching technique elements are eliminated by half in each pass.

A. Linear search

B. Binary search

C. both

D. none                                                                                      [ B ]

 10. Running time of Selection sort algorithm is -----.

A. O( log2 n)

B. O( n log n)

C. O(n)        

D. O(n2)                                                                                     [ D ]

 11. Time complexity of insertion sort algorithm in best case is

A. O( log n)

C. O(n)

B. O( n log n)

D. O(n2)                                                                                     [ C ]

 12. Binary search algorithm performs efficiently on a

A. linked list

B. array

C. both

D. none                                                                                      [ B ]

 13. Which among the following is a linear data structure:

A. Queue

B. Stack

C. Linked List

D. all the above                                                                           [ D ]

 14. A stack is a data structure in which all insertions and deletions of entries are made at:

A. One end

C. Both the ends

B. In the middle

D. At any position                                                                        [ A ]

 15. A queue is a data structure in which all insertions and deletions are made respectively at:

A. rear and front

B. front and front

C. front and rear

D. rear and rear                                                                          [ A ]

 16. Queue is also known as:

A. Last in first out list

B. First in first out list

C. both A and B

D. none of the above                                                                    [ B ]

 17. One difference between a queue and a stack is:

A. Queues require dynamic memory, but stacks do not.

B. Stacks require dynamic memory, but queues do not.

C. Queues use two ends of the structure; stacks use only one.

D. Stacks use two ends of the structure, queues use only one.            [ C ]

18. If the characters 'D', 'C', 'B', 'A' are placed in a queue (in that order), and then removed one at a time, in what order will they be removed?

A. ABCD

B. ABDC

C. DCAB

D. DCBA                                                                                     [ D ]

 19. Linked 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. data structure

          D. none of above situation                                                             B

 20. The operation of processing each element in the list is known as____

        A. sorting

        B. merging

        C. inserting

        D. traversal                                                                                Ans: D

 21. The situation when in a linked list START=NULL is____

        A. Underflow

        B. Overflow

        C. Houseful

        D. Saturated                                                                               Ans: A

 22. Each node in singly linked list has____fields.

A. 2

B. 3

C. 1

D. 4                                                                                           Ans: A

 23. In linked lists there are no NULL links in

A.  single linked list

B. linear doubly linked list

C. circular linked list

D. linked list                                                                                Ans: C

 

24. Each node in a linked list must contain at least___

A. Three fields

B. Two fields

C. Four fields

D. Five fields                                                                               Ans: B

 25. In a linked list the..... field contains the address of next element in the list.

A. Link field

B. Next element field

C. Start field

D. Info field                                                                                 Ans: A

 26. A linear list in which the pointer points only to the successive node is......

A. singly linked list

B. circular linked list

C. doubly linked list

D. none of the above                                                                    Ans: A

 27. A linear list in which the last node points to the first node is_____

A. singly linked list

B. circular linked list

C. doubly linked list

D. none of the above                                                                    Ans: B

28. A singly linked list is also called as........

A. linked list

B. one way chain

C. two way chain

D. right link                                                                                 Ans: B

 

29. In a linked list, insertion can be done at.........

A. beginning

B. end

C. middle

D. all of the above                                                                        Ans: D

 30. A linear list in which each node has point to the predecessor and successors nodes is called ........

A.  singly linked list

B. circular linked list

C. doubly linked list

D. linear linked list                                                                        Ans: C

 

31. Finding the location of a given item in a collection of items is called......

A.  Discovering

B. Finding

C. Searching

D. Mining                                                                                    Ans: C

 

 

 

 

 

 

 

 

 

 

 

Comments