Exam 16: Sorting, Searching, and Algorithm Analysis

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The method findMax shown below is supposed to return the position of the largest Value in the portion of an array between 0 and last,inclusive: Int findMax(int array[ ],int last){ Int maxPos = 0; For (int k = 1;k < = last;k++){ // Code is Missing } Return maxPos; } The missing code is

(Multiple Choice)
4.9/5
(27)

The bubble sort algorithm works by

(Multiple Choice)
4.8/5
(39)

Suppose that we are searching for an item X in an array sorted in descending order.If we find that X is smaller than the middle item of the array,then we should continue our search in the half of the array whose elements

(Multiple Choice)
4.8/5
(35)

The worst case complexity function f(n)of an algorithm

(Multiple Choice)
4.9/5
(41)

The following implementation of QuickSort Static void doQuickSort(int array[ ],int start,int end){ Int pivotPoint; PivotPoint = partition(array,start,end); DoQuickSort(array,pivot+1,end); DoQuickSort(array,start,pivot-1); }

(Multiple Choice)
4.9/5
(41)

Sequential Search is in the complexity class

(Multiple Choice)
4.7/5
(27)
Showing 41 - 46 of 46
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)