Sorting - PowerPoint PPT Presentation

About This Presentation
Title:

Sorting

Description:

Tujuan : Mahasiswa dapat Menunjukkan teknik sorting dalam pemograman terstruktur dengan menggunakan pseudocode Sort instructions arrange records in an order based on ... – PowerPoint PPT presentation

Number of Views:129
Avg rating:3.0/5.0
Slides: 23
Provided by: Dosen8
Category:
Tags: sort | sorting | swap

less

Transcript and Presenter's Notes

Title: Sorting


1
Sorting
Tujuan Mahasiswa dapat Menunjukkan teknik
sorting dalam pemograman terstruktur dengan
menggunakan pseudocode
2
Defini dan Jenis Sort
  • Sort ? instructions arrange records in an order
    based on a field or fields within each record
  • Jenis Sort
  • gt Ascending ? from smallest to largest
  • gt Descending ? from largest to smallest
  • Primary Key Secondary Key

3
Embedded Sort
  • Initialize the sort work area
  • Sort instruction require at least one temporary
    soft file
  • Be set up by the program
  • Automatically written to the output file
    specified

4
Interchange Sort
  • First step Swap / interchange first entry with
    higest entry
  • 50 82 56 77 32 90 95 88 62 99
  • 99 82 56 77 32 90 95 88 62 50

5
Interchange Sort
  • Second Step Swap second enry with highest value
    (exclude first entry)
  • 99 82 56 77 32 90 95 88 62 50
  • 99 95 56 77 32 90 82 88 62 50

6
Interchange Sort
  • Third Step Swap third entry with highest value
    (exclude first two entries)
  • 99 95 56 77 32 90 82 88 62 50
  • 99 95 90 77 32 56 82 88 62 50

7
Interchange Sort
  • Fourth Step Swap fourth entry with highest
    entry (exclude first three entries)
  • 99 95 90 77 32 56 82 88 62 50
  • 99 95 90 88 32 56 82 77 62 50

8
Interchange Sort
  • Fifth Step Swap fifth entry with highest value
    (exclude first four entries)
  • 99 95 90 88 32 56 82 77 62 50
  • 99 95 90 88 82 56 32 77 62 50

9
Interchange Sort
  • Sixth Step Swap sixth entry with highes value
    (exclude first five entries)
  • 99 95 90 88 82 56 32 77 62 50
  • 99 95 90 88 82 77 32 56 62 50

10
Interchange Sort
  • Seventh Step Swap seventh entry with highest
    value (exclude first six entries)
  • 99 95 90 88 82 77 32 56 62 50
  • 99 95 90 88 82 77 62 56 32 50

11
Interchange Sort
  • Eight Step Swap eight entry with highest value
    (exclude first seven entries)
  • 99 95 90 88 82 77 62 56 32 50
  • 99 95 90 88 82 77 62 56 32 50

12
Interchange Sort
  • Ninth Step Swap ninth entry with highest value
    (exclude first eight entries)
  • 99 95 90 88 82 77 62 56 32 50
  • 99 95 90 88 82 77 62 56 50 32

13
Bubble Sort
  • First step Compare and swap adjacent entries in
    the entire array
  • 50 82 56 77 32 90 95 88 62 99
  • 82 56 77 50 90 95 88 62 99 32

50
50
50
82
56
32
32
77
32
50
90
32
95
32
88
32
62
99
14
Bubble Sort
  • Second step Compare and swap adjacent entries
    (exclude the last entry)
  • 82 56 77 50 90 95 88 62 99 32
  • 82 77 56 90 95 88 62 99 50 32

56
56
50
82
77
50
50
56
50
90
95
50
88
50
62
99
15
Bubble Sort
  • Third step Compare and swap adjacent entries
    (exclude the last two entries)
  • 82 77 56 90 95 88 62 99 50 32
  • 82 77 90 95 88 62 99 56 50 32

77
56
56
82
77
56
56
90
56
95
88
56
62
99
16
Bubble Sort
  • Fourth step Compare and swap adjacent entries
    (exclude the last three entries)
  • 82 77 90 95 88 62 99 56 50 32
  • 82 90 95 88 77 99 62 56 50 32

77
77
77
82
90
77
62
95
62
88
77
99
17
Bubble Sort
  • Fifth step Compare and swap adjacent entries
    (exclude the last four entries)
  • 82 90 95 88 77 99 62 56 50 32
  • 90 95 88 82 99 77 62 56 50 32

82
82
82
90
95
77
77
88
82
99
18
Bubble Sort
  • Sixth step Compare and swap adjacent entries
    (exclude the last five entries)
  • 90 95 88 82 99 77 62 56 50 32
  • 95 90 88 99 82 77 62 56 50 32

90
88
82
95
90
82
88
99
19
Bubble Sort
  • Seventh step Compare and swap adjacent entries
    (exclude the last six entries)
  • 95 90 88 99 82 77 62 56 50 32
  • 95 90 99 88 82 77 62 56 50 32

90
88
88
95
90
99
20
Bubble Sort
  • Eight step Compare and swap adjacent entries
    (exclude the last seven entries)
  • 95 90 99 88 82 77 62 56 50 32
  • 95 99 90 88 82 77 62 56 50 32

90
90
95
99
21
Bubble Sort
  • Ninth step Compare and swap adjacent entries
    (exclude the last eight entries)
  • 95 99 90 88 82 77 62 56 50 32
  • 99 95 90 88 82 77 62 56 50 32

95
99
22
Tugas Kelompok
  • Maksimal 5 Orang untuk 1 Kelompok
  • Buat Latihan Logic Exercise soal no.6 hal 241
    dari buku Programming Logic for Business Laura
    Saret
  • Buat Pseudocode dan flowchartnya
  • Kumpulkan minggu depan
Write a Comment
User Comments (0)
About PowerShow.com