Look up how to do an insertion sort. Write a method to do a insertion sort of an array of names. See the StringArraySorter class in the directory bookClass- esFinal.
What will be an ideal response?
```
/? ?
? Method t o do an i n s e r t i o n s o r t on t h e a r r a y
?/
public void i n s e r t i o n S o r t ( )
{
S t r i n g temp = null ;
i n t pos = 0 ;
// l o o p from s e c o n d e l e m e n t on
f o r ( i n t i = 1 ; i < a . l e n g t h ; i ++)
{
// s a v e c u r r e n t v a l u e a t i and s e t p o s i t i o n t o i
temp = a [ i ] ;
pos = i ;
// s h i f t r i g h t any l a r g e r e l e m e n t s
while ( 0 < pos && temp . compareTo ( a [ pos ? 1 ] ) < 0 )
{
a [ pos ] = a [ pos ? 1 ] ;
pos ??;
}
a [ pos ] = temp ;
t h i s . p r i n t A r r a y ( ” a f t e r l o o p body when i = ” + i ) ;
}
}
```
You might also like to view...
A(n) ____ variable can have either of just two values: true or false.
A. Double B. String C. Object D. Boolean
This is used to create a virtual link from one site to the other. It essentially replaces the traditional WAN-type connection used in connecting typical sites.
What will be an ideal response?
Match each of the following File Explorer items to its use:
I. Quick Access Toolbar II. Ribbon III. Search box IV. Address bar V. Navigation pane A. contains icons for frequently used commands B. contains the path to the current location in the File Explorer window C. used to travel through the folders and drives available on a computer D. used to look for files located in the current File Explorer window E. used to perform common tasks on the items in the file list area
Match each item with a statement below.
A. Shortens the time it takes to write a change from buffer to disk B. Allows for updates and changes to a database at the same time, improving data loading and manipulation speeds C. Provides a method for applying security to specific rows of a table D. A tool that provides synchronization of replicated databases E. Eliminates the need for processes participating in online operation to maintain exclusive access to tables F. A tool that allows for the precomputing of data and prejoining of tables, increasing performance by improving query performance G. A divide-and-conquer approach to large-table and full-table scans H. A tool that allows for bidirectional copying of database objects, procedures, and indexes I. Enables the creation of failover databases for instances of failure