Java Programming

Computing

Quiz 14 :

Searching and Sorting

Quiz 14 :

Searching and Sorting

Question Type
search
arrow
In a selection sort, a list is sorted by selecting elements in the list, one at a time, and moving them to their proper positions.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
In a sequential search, you search an array starting from the middle component.
Free
True False
Answer:

Answer:

False

Tags
Choose question tag
close menu
arrow
A list is a set of related values that do not necessarily have the same type.
Free
True False
Answer:

Answer:

False

Tags
Choose question tag
close menu
arrow
To sort a list of 1000, selection sort makes about 5,000 key comparisons.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In the binary search algorithm, two key comparisons are made through every iteration of the loop.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In insertion sort, during the sorting phase the array containing the list is divided into three sublists.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Selection sort swaps the smallest element in the unsorted portion of the list to a new position.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Key comparisons are also called item comparisons.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Suppose that you have the following list. int[] list = {2, 4, 6, 8, 10, 12, 14, 16}; Further assume that binary search is used to determine whether 15 is in list. When the loop terminates, the value of the index variable last is 6.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In a sequential search, the array must be sorted.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Selection sort uses nested for loops.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A selection sort always starts with the middle element of the list.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A sequential search is most efficient for large lists.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The selection sort algorithm repeatedly moves the smallest element from the unsorted list to the top of the unsorted list.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In selection sort, initially, the entire list, that is, list[0]...list[listLength], is the unsorted list.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The insertion sort algorithm sorts a list by repeatedly inserting an element in its proper place into a sorted sublist.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A binary search can be performed on both sorted and unsorted lists.
True False
Answer:
Tags
Choose question tag
close menu
arrow
On average, the number of comparisons made by a sequential search is equal to one-third the size of the list.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Insertion sort makes approximately the same number of key comparisons as item assignments.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A binary search starts by comparing the search item to the first item in the list.
True False
Answer:
Tags
Choose question tag
close menu
Showing 1 - 20 of 50