ITE/CS no.5 Flashcards
A type of control structure that enables programs to perform statements repeatedly as long as a condition remains true.
LOOPING CONTROL STRUCTURE
Also called finite loops
INDEX LOOPS
Also called unended loops
INFINITE LOOPS
- Repeats a statement or group of statements while a given condition is true.
- It tests the condition before executing the loop body.
- minimum output is 0 or more
WHILE LOOP
- It executes the code block once, before checking if the condition is TRUE, then it will repeat as long as the condition is TRUE.
- minimum output is 1 or more
DO WHILE LOOP
- A repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times
- the minimum output is 0 or more
FOR LOOP
It is a collection of data items, all of the same type, accessed using a common name.
ARRAYS
These are declared by providing more than one set of square [ ] brackets after the variable name in the declaration statement.
MULTIDIMENSIONAL ARRAYS
________ dimensional arrays do not require the dimension to be given if the array is to be completely initialized.
ONE DIMENSIONAL ARRAYS
these are used to rearrange a given array or list elements according to a comparison operator on the elements
SORTING ALGORITHMS
list in which data items are placed in a particular order
SORTED LIST
list in which data items are placed in no particular order; the only relationships between data elements are the list predecessor and successor relationships.
UNSORTED LIST
A category of unsorted list in which the arrangement of the elements are in decreasing order, then you need to sort it in increasing order
WORST CASE
A category of unsorted list in which the arrangement of the elements are in random order, then you need to sort it in increasing order
AVERAGE CASE
A category of unsorted list in which the arrangement of the elements are in increasing order, then you need to sort it in increasing order
BEST CASE
- an arrangement of its members into a sequence or linear order, or if the set is already ordered, a rearrangement of its elements.
- the act or process of changing the linear order of an ordered set.
PERMUTATION
It is the process in which a new permutation is formed
PASS (P0 to Pn)
the exchanging of values from different locations or exchanging positions of two values.
SWAP
- it is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order.
- also referred to as sinking sort
BUBBLE SORT
It sorts an array by repeatedly by finding the minimum element (considering ascending order) from the unsorted part and putting it at the beginning.
SELECTION SORT
- The sorting mechanism where the sorted array is built having one item at a time.
- The array elements are compared with each other sequentially and then arranged simultaneously in some particular order
INSERTION SORT