A prototype is a set of communication rules for the exchange of information.

Answer the following statement true (T) or false (F)


False

Computer Science & Information Technology

You might also like to view...

How does caching improve the performance of a Web browser? Does caching reduce the number of interactions that take place between the browser and the Web server?

What will be an ideal response?

Computer Science & Information Technology

The ____________ selection statement is used to execute one action when a condition is true or a different action when that condition is false.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Add a method bubbleSort to the class ArraySorter, as given in Listing 7.10, that performs a bubble sort of an array. The bubble sort algorithm examines all adjacent pairs of elements in the array from the beginning to the end and interchanges any two elements that are out of order. Each interchange makes the array more sorted than it was, until it is entirely sorted. The algorithm in pseudocode follows:

``` Bubble sort algorithm to sort an array a Repeat the following until the array a is sorted: for (index = 0; index < a.length ? 1; index++) if (a[index] > a[index + 1]) Interchange the values of a[index] and a[index + 1]. ``` The bubble sort algorithm usually requires more time than other sorting methods. This project requires an extension of the bubble sort algorithm outlined in the problem description because it gives pseudo-code for just one pass through the array, which puts only the highest remaining number in its correct slot. Additional passes (repetitions of the algorithm) are necessary until the array is completely sorted. Playing around with some simple examples can reveal how bubble sort works and the criteria for ending the loop and is a good exercise for students. Best case is when the array is already sorted (nothing needs to be swapped), worst case is when it is exactly backwards (everything needs to be swapped), and other orderings are somewhere in between. An efficient algorithm will detect when the loop is sorted and stop processing it. A flag can be used to detect the situation where the array is already sorted; set the flag to true before executing the swap loop and change it to false if a swap occurs - whenever the array is processed without doing a swap it is obviously sorted. At the other extreme, the worst case ordering shows that there is an upper limit to the number of iterations after which the array is guaranteed sorted. Notice that, for a loop with n elements, only n-1 comparisons of adjacent elements are required to move the largest element into its proper place. The next iteration should process the remaining n-1 elements (after the nth element which is correctly positioned), so it will process n-2 elements and result in the last two elements being properly placed, etc. Following this scenario leads to the conclusion that n-1 passes for an n-element array guarantees the array has been sorted, and each iteration needs to process one less element (the last element in the previous iteration). Combining these two criteria gives an efficient algorithm for sorting an array of n elements: repeat the swap loop until the swap flag stays true for the iteration, up to a maximum of n-1 times. Following the approach in the text, an additional class, BubbleSortDemo, is used to demonstrate the bubble sort method with a sample array.

Computer Science & Information Technology

Drivers are used by the operating system

Indicate whether the statement is true or false

Computer Science & Information Technology