lab12 t/f

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

The binary searching algorithm should always be used for searching.

F

The sequential and binary searching algorithms perform in the same amount of time when a target value is not present in an array.

F

If a target value is not present in a sorted list then every element of that list must be compared before that fact can be determined.

T

It is possible that during a single pass of the selection sorting algorithm that the order of the data in the array will be the same as it was after the previous pass.

T

Prior to making use of the binary search the data in the array must be in a sorted state.

T

The binary searching algorithm can be modified to work with an array that has been sorted from largest (at index zero) to smallest (at index SIZE of the array minus one).

T

The binary searching algorithm will always find a target in an array faster than the sequential searching algorithm.

T

The binary searching algorithm will terminate when the first variable is greater than the last.

T

The loop control expression of the binary search as seen on line 23 of the program on page 509 of the C programming text may be false when either (1) the target has been found or (2) it has been determine that the target value is not present in the array.

T

To sort an array of N elements a N - 1 sort passes are required to guarantee that data always ends in a sorted state.

T

Values once placed in the sorted sublist of the insertion sort are subject to be moved again as the algorithm progresses.

T

With each comparison made in the binary search approximately half of the remaining elements in the array are eliminated as possible locations of the target.

T

Exchanging the '<' for a '>' in the code on line 21 of page 495 of the C programming text will sort the data in the array from largest (index 0) to smallest (index of last minus one).

f

Once the insertion sort places a value in the sorted list that value will never move again in the remainder of the passes

f

The bubble sort operates faster when moving the larger values to the highest index than when moving the smaller values towards index zero.

f

The bubble sorting algorithm is optimized to stop the sorting process when the array is detected as being in a sorted state.

f

The insertion sorting algorithm will complete one exchange involving at most two elements per pass.

f

The selection sorting algorithm can only be used to sort data in an ascending order (from smallest to largest).

f

To determine a target value is not found in an unsorted list while using the sequential searching algorithm every element must be examined.

f

A (sort) pass is the movement of one element from the unsorted to sorted sublist.

t

In all three sorting algorithms studied the list (array) is divided into two sublists (subsections), sorted and unsorted

t

In general, the use of the sequential search is limited to small data sets or those that are not searched often.

t

On the final pass through the selection sorting algorithm TWO values are brought over from the unsorted list into the sorted list.

t

One motivation for making use of the binary search instead of the sequential search is the poor worst case performance of using the sequential search with a large data set

t

The binary searching algorithm is not applicable when the values found in the array are not unique.

t

The bubble sorting algorithm compares neighboring elements in the unsorted list of the array and swaps their positions when they are not in the desired order.

t

The bubble sorting algorithm will complete one exchange involving at most two elements per pass.

t

The goal of a searching algorithm is to find the location of a target element inside of an array.

t

The insertion sort takes a value from the unsorted sublist and inserts it into the proper location of the sorted sublist based on the values currently present in the sorted sublist.

t

The insertion sorting algorithm begins with one value in the sorted list before the first pass.

t

The number of exchanges that can potentially occur on a given pass of the bubble sort may be greater than 1

t

The outer loop in each of the three sorting algorithms is responsible for ensuring the number of passes required are completed

t

The right operand to the && operator on line 21 of the sequential searching algorithm found on page 504 of the C programming text is to stop the searching process once the target has been found.

t

The selection sort will identify one value in the unsorted sublist to move and become a part of the sorted sublist.

t

The selection sorting algorithm will complete one exchange involving at most two elements per pass.

t

The sequential searching algorithm found on page 504 of the C programming text communicates two values with the calling function, a logic value that determines if the target was found and a second integer value that represents the index at which the target was found

t


संबंधित स्टडी सेट्स

1 - Accounting: The Language of Business

View Set

Network+ Chapter 5 Networking Devices

View Set

Personal property, Real property, Bailments, and Landlord-Tenant Law

View Set

Religion-Understanding the Scriptures Chapter 3

View Set