In programming the cases base often happened have never got out of some repetition techniques and condition.
As for the case dealing with the repetition and condition is [at] programming presenting array ( queue) and validate.
ARRAY & VALIDATION
Usage Flowchart for analysis array will always use the repetition method ( looping). Then process Arrange require the sequence technique and queue.
There are some the Algorithm sequence techniques often in using:
- Bubble Sort
- Selection Sort
- Insertion Sort
- Shell Sort
- Merge Sort
- Heap Sort
- Quick Sort
- Bucket Sort
- Radix Sort
Bubble Sort
Step for the shake of step Bubble Sort:
Take example is array ( 70519) then will in sorting from small which become larger ones:
First Step :
(7 0 5 1 9) → (0 7 5 1 9) , membandingkan 2 element pertama kemudian tukar posisi.
(0 7 5 1 9) → (0 5 7 1 9)
(0 5 7 1 9) → (0 5 1 7 9)
(0 5 1 7 9) → (0 5 1 7 9), 2 element terakhir telah terurut sehingga tidak di tukar.
Second Step :
(0 5 1 7 9) → (0 5 1 7 9)
(0 5 1 7 9) → (0 1 5 7 9)
(0 1 5 7 9) → (0 1 5 7 9)
(0 1 5 7 9) → (0 1 5 7 9)
Now, all lines have been massaged, is but needed to check again without happened the repetition, to prove that line have been massaged by the correctness.
(0 1 5 7 9) → (0 1 5 7 9)
(0 1 5 7 9) → (0 1 5 7 9)
(0 1 5 7 9) → (0 1 5 7 9)
(0 1 5 7 9) → (0 1 5 7 9)
Finally [there] no conversion process element so that prove that line have been massaged.
Flowchart to explain the above algorithm as follows:
No comments:
Post a Comment