Analysis of Algorithms and Computational Complexity Questions and Answers
Practice ModeShowing 10 of 239 questions
Q141
Which of the following lines of code will delete two successive nodes of a singly linked linear list (WITH MORE THAN 2 NODES) ? Assume this code is in the main program, not a subprocedure
Answer: Option D
Q142
If memory for the run-time stack is only 150 cells (words), how big can N be in Factorial (N) before encountring stack overflow?
Answer: Option C
Q143
How many comparisons are required to sort an array of length 5 if a straight selection sort is used and the array is already sorted in the opposite order ?
Answer: Option D
Q144
With round-robin CPU scheduling in a time-shared system
Answer: Option A
Q145
Sorting data means to arrange it in ------order
Answer: Option C
Q146
Data sorted from the largest value to the smallest value is sorted in
Answer: Option B
Q147
If the binary search algorithm determines that the search argument is in the upper half of the array, which of the following statements will set the appropriate variable to the appropriate value?
Answer: Option A
Q148
Which of the following statements is used in the binary search algorithm to halve the array ?
Answer: Option B
Q149
The _____ algorithm works by comparing adjacent array that are out of order.
Answer: Option A
Q150
When you use the bubble sort, the first step in swapping two of the elements in the salary array is to
Answer: Option A