Multiple Choice Question on Data Structure and Algorithm Design

Q1. The estimated amount of time required in executing an algorithm is referred to as _____ of the algorithm.
a: time complexity

b: space complexity
c: time and space complexity
d: none of the above

Q2. If all the data to be sorted does not fit entirely in main memory, the sorting technique used is:
a: internal sorting
b: external sorting
c: merge sorting
d: sorting can not be performed

Q3. The searching technique suitable for unsorted arrays:
a: binary search
b: linear search
c: any of these
d: none of these

Q4. A theoretical measure of algorithm execution, usually the time/ memory needed , given the problem size n , is referred to as:
a: Big O notation
b: Polish notation
c: Time notation
d: space complexity

Q5. The technique of collecting unused memory is known as:
a: garbage collection
b: Dynamic memory allocation
c: static memory allocation

d: none of these

Q6. The root node of a binary tree whose pre-order traversal is: F,B,A,D,C,E,G, I, H is:
a: F
b: H
c: C
d: none of these

Q7. The post-order traversal of an arithmetic expression will result in the expression being represented as:
a: postfix
b: prefix
c: infix
d: none of the above

Q8. The main measures for the efficiency of an algorithm are:
a: processor and memory
b: complexity and capacity
c: time and space
d: data and space

Q9.Which of the following cases does not exist in complexity theory:

a: best case
b: worst case
c: average case
d: Null case

Q10. The worst case occurs in linear search algorithm when:
a: item is in the middle of the array
b: item is not in the array
c: item is the last element in the array                  
d: item is the last element in the array or not in the array at-all
Q11.The complexity of merge sort algorithm is:
a: O(n)
b: O(log n)
c: O(n2)
d: O(n log n)

Q12.The complexity of linear search algorithm is:
a: O(n)
b: O(log n)
c: O(n2)
d: O(n log n)

Q13.Which of the following data structures is not a linear data structure:
a: arrays
b: linked lists
c: both of the above

d: none of the above

Q14. Linked lists are best suited:
a: for relatively permanent collections constantly changing
b: when the size of structure is 
c: for both the above situations
d: for none of the above situations

Q15. The memory address of the first element of an array is called:
a: floor address
b: foundation address
c: first address
d: base address

Q16. The memory address of the fifth element of an array can be calculated by the formula:
a: Base(Array)+w(5-lower bound) where w is the size of each element of array
b: Base(Array[5])+(5-lower bound)
c: Base(Array[5])+(5-upper bound)
d: none of the above

Q17. Which of the following data-structures are indexed structures:
a: linear arrays
b: linked lists
c: both of the above
d: none of the above

Q18. Which of the following is not the required condition for binary search algorithm:
a: the list must be sorted
b: a direct access to middle element is needed 

c: a mechanism to delete/insert elements in list
d: None of the above
Q19. Which of the following data structures can’t store non-homogeneous data-elements:
a: Arrays
b: Records
c: Pointers
d: None

Q20. Which of the following statements is false:
a: Arrays are static data structures
b: data elements in linked list need not be stored in adjacent space in memory

c: pointer stores the next data element of  a list
d: linked lists are collection of nodes that contain information part & next pointer   

Mukesh Rajput
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:


Mukesh Rajput