Update Sorting for id translation

This commit is contained in:
hexatester 2021-01-02 14:29:14 +07:00
parent f4a4710c7c
commit 86d371438e
1 changed files with 61 additions and 60 deletions

View File

@ -54,7 +54,7 @@ Jika Anda ingin menjadi teknisi ketahanan sistem atau teknisi sistem, lebih bany
- [Heap / Priority Queue / Binary Heap](#heap--priority-queue--binary-heap)
- balanced search trees (konsep dasar, tidak mendalam)
- traversals: preorder, inorder, postorder, BFS, DFS
- [Sorting](#sorting)
- [Penyortiran](#penyortiran)
- selection
- insertion
- heapsort
@ -779,79 +779,80 @@ Menulis kode pada papan tulis atau kertas, bukan komputer. Uji dengan beberapa s
- [ ] heap_sort() - take an unsorted array and turn it into a sorted array in-place using a max heap
- note: using a min heap instead would save operations, but double the space needed (cannot do in-place).
## Sorting
## Penyortiran
- [ ] Notes:
- Implement sorts & know best case/worst case, average complexity of each:
- no bubble sort - it's terrible - O(n^2), except when n <= 16
- [ ] stability in sorting algorithms ("Is Quicksort stable?")
- [Sorting Algorithm Stability](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability)
- [Stability In Sorting Algorithms](http://stackoverflow.com/questions/1517793/stability-in-sorting-algorithms)
- [Stability In Sorting Algorithms](http://www.geeksforgeeks.org/stability-in-sorting-algorithms/)
- [Sorting Algorithms - Stability](http://homepages.math.uic.edu/~leon/cs-mcs401-s08/handouts/stability.pdf)
- [ ] Which algorithms can be used on linked lists? Which on arrays? Which on both?
- I wouldn't recommend sorting a linked list, but merge sort is doable.
- [Merge Sort For Linked List](http://www.geeksforgeeks.org/merge-sort-for-linked-list/)
- [ ] Catatan:
- Terapkan sort & ketahui kasus terbaik / kasus terburuk, kompleksitas rata-rata masing-masing:
- tidak ada bubble sort - ini mengerikan - O(n^2), kecuali jika n<=16
- [ ] Stabilitas dalam algoritme pengurutan ("Apakah Quicksort stabil?")
- [Stabilitas Algoritma Penyortiran](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability)
- [Stabilitas Dalam Mengurutkan Algoritma](http://stackoverflow.com/questions/1517793/stability-in-sorting-algorithms)
- [Stabilitas Dalam Mengurutkan Algoritma](http://www.geeksforgeeks.org/stability-in-sorting-algorithms/)
- [Algoritma Pengurutan - Stabilitas](http://homepages.math.uic.edu/~leon/cs-mcs401-s08/handouts/stability.pdf)
- [ ] Algoritme mana yang dapat digunakan pada linked lists? Yang mana pada array? Yang mana pada keduanya?
- Saya tidak akan merekomendasikan pengurutan linked lists, tetapi penggabungan semacam bisa dilakukan.
- [Merge Sort Untuk Linked List](http://www.geeksforgeeks.org/merge-sort-for-linked-list/)
- For heapsort, see Heap data structure above. Heap sort is great, but not stable.
- Untuk heapsort, lihat struktur data Heap di atas. Jenis heap bagus, tapi tidak stabil
- [ ] [Sedgewick - Mergesort (5 videos)](https://www.youtube.com/watch?v=4nKwesx_c8E&list=PLe-ggMe31CTeunC6GZHFBmQx7EKtjbGf9)
- [ ] [1. Mergesort](https://www.youtube.com/watch?v=4nKwesx_c8E&list=PLe-ggMe31CTeunC6GZHFBmQx7EKtjbGf9&index=1)
- [ ] [2. Bottom up Mergesort](https://www.youtube.com/watch?v=HGOIGUYjeyk&list=PLe-ggMe31CTeunC6GZHFBmQx7EKtjbGf9&index=2)
- [ ] [3. Sorting Complexity](https://www.youtube.com/watch?v=WvU_mIWo0Ac&index=3&list=PLe-ggMe31CTeunC6GZHFBmQx7EKtjbGf9)
- [ ] [4. Comparators](https://www.youtube.com/watch?v=7MvC1kmBza0&index=4&list=PLe-ggMe31CTeunC6GZHFBmQx7EKtjbGf9)
- [ ] [5. Stability](https://www.youtube.com/watch?v=XD_5iINB5GI&index=5&list=PLe-ggMe31CTeunC6GZHFBmQx7EKtjbGf9)
- [ ] [Sedgewick - Mergesort (5 video)](https://www.coursera.org/learn/algorithms-part1/home/week/3)
- [ ] [1. Penggabungan](https://www.coursera.org/learn/algorithms-part1/lecture/ARWDq/mergesort)
- [ ] [2. Mergesort dari bawah ke atas](https://www.coursera.org/learn/algorithms-part1/lecture/PWNEl/bottom-up-mergesort)
- [ ] [3. Kompleksitas Sortir](https://www.coursera.org/learn/algorithms-part1/lecture/xAltF/sorting-complexity)
- [ ] [4. Pembanding](https://www.coursera.org/learn/algorithms-part1/lecture/9FYhS/comparators)
- [ ] [5. Stabilitas](https://www.coursera.org/learn/algorithms-part1/lecture/pvvLZ/stability)
- [ ] [Sedgewick - Quicksort (4 videos)](https://www.youtube.com/playlist?list=PLe-ggMe31CTeE3x2-nF1-toca1QpuXwE1)
- [ ] [1. Quicksort](https://www.youtube.com/watch?v=5M5A7qPWk84&index=1&list=PLe-ggMe31CTeE3x2-nF1-toca1QpuXwE1)
- [ ] [2. Selection](https://www.youtube.com/watch?v=CgVYfSyct_M&index=2&list=PLe-ggMe31CTeE3x2-nF1-toca1QpuXwE1)
- [ ] [3. Duplicate Keys](https://www.youtube.com/watch?v=WBFzOYJ5ybM&index=3&list=PLe-ggMe31CTeE3x2-nF1-toca1QpuXwE1)
- [ ] [4. System Sorts](https://www.youtube.com/watch?v=rejpZ2htBjE&index=4&list=PLe-ggMe31CTeE3x2-nF1-toca1QpuXwE1)
- [ ] [Sedgewick - Quicksort (4 video)](https://www.coursera.org/learn/algorithms-part1/home/week/3)
- [ ] [1. Quicksort](https://www.coursera.org/learn/algorithms-part1/lecture/vjvnC/quicksort)
- [ ] [2. Seleksi](https://www.coursera.org/learn/algorithms-part1/lecture/UQxFT/selection)
- [ ] [3. Kunci Duplikat](https://www.coursera.org/learn/algorithms-part1/lecture/XvjPd/duplicate-keys)
- [ ] [4. System Sorts](https://www.coursera.org/learn/algorithms-part1/lecture/QBNZ7/system-sorts)
- [ ] UC Berkeley:
- [ ] [CS 61B Lecture 29: Sorting I (video)](https://www.youtube.com/watch?v=EiUvYS2DT6I&list=PL4BBB74C7D2A1049C&index=29)
- [ ] [CS 61B Lecture 30: Sorting II (video)](https://www.youtube.com/watch?v=2hTY3t80Qsk&list=PL4BBB74C7D2A1049C&index=30)
- [ ] [CS 61B Lecture 32: Sorting III (video)](https://www.youtube.com/watch?v=Y6LOLpxg6Dc&index=32&list=PL4BBB74C7D2A1049C)
- [ ] [CS 61B Lecture 33: Sorting V (video)](https://www.youtube.com/watch?v=qNMQ4ly43p4&index=33&list=PL4BBB74C7D2A1049C)
- [ ] [CS 61B Kuliah 29: Penyortiran I (video)](https://archive.org/details/ucberkeley_webcast_EiUvYS2DT6I)
- [ ] [CS 61B Kuliah 30: Penyortiran II (video)](https://archive.org/details/ucberkeley_webcast_2hTY3t80Qsk)
- [ ] [CS 61B Kuliah 32: Penyortiran III (video)](https://archive.org/details/ucberkeley_webcast_Y6LOLpxg6Dc)
- [ ] [CS 61B Kuliah 33: Penyortiran V (video)](https://archive.org/details/ucberkeley_webcast_qNMQ4ly43p4)
- [ ] [Bubble Sort (video)](https://www.youtube.com/watch?v=P00xJgWzz2c&index=1&list=PL89B61F78B552C1AB)
- [ ] [Analyzing Bubble Sort (video)](https://www.youtube.com/watch?v=ni_zk257Nqo&index=7&list=PL89B61F78B552C1AB)
- [ ] [Insertion Sort, Merge Sort (video)](https://www.youtube.com/watch?v=Kg4bqzAqRBM&index=3&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb)
- [ ] [Insertion Sort (video)](https://www.youtube.com/watch?v=c4BRHC7kTaQ&index=2&list=PL89B61F78B552C1AB)
- [ ] [Menganalisis Bubble Sort (video)](https://www.youtube.com/watch?v=ni_zk257Nqo&index=7&list=PL89B61F78B552C1AB)
- [ ] [Sortir Penyisipan, Sortir Gabung (video)](https://www.youtube.com/watch?v=Kg4bqzAqRBM&index=3&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb)
- [ ] [Sortir Penyisipan (video)](https://www.youtube.com/watch?v=c4BRHC7kTaQ&index=2&list=PL89B61F78B552C1AB)
- [ ] [Merge Sort (video)](https://www.youtube.com/watch?v=GCae1WNvnZM&index=3&list=PL89B61F78B552C1AB)
- [ ] [Quicksort (video)](https://www.youtube.com/watch?v=y_G9BkAm6B8&index=4&list=PL89B61F78B552C1AB)
- [ ] [Selection Sort (video)](https://www.youtube.com/watch?v=6nDMgr0-Yyo&index=8&list=PL89B61F78B552C1AB)
- [ ] [Sortir Pilihan (video)](https://www.youtube.com/watch?v=6nDMgr0-Yyo&index=8&list=PL89B61F78B552C1AB)
- [ ] Merge sort code:
- [ ] [Using output array (C)](http://www.cs.yale.edu/homes/aspnes/classes/223/examples/sorting/mergesort.c)
- [ ] [Using output array (Python)](https://github.com/jwasham/practice-python/blob/master/merge_sort/merge_sort.py)
- [ ] [In-place (C++)](https://github.com/jwasham/practice-cpp/blob/master/merge_sort/merge_sort.cc)
- [ ] Quick sort code:
- [ ] [Implementation (C)](http://www.cs.yale.edu/homes/aspnes/classes/223/examples/randomization/quick.c)
- [ ] [Implementation (C)](https://github.com/jwasham/practice-c/blob/master/quick_sort/quick_sort.c)
- [ ] [Implementation (Python)](https://github.com/jwasham/practice-python/blob/master/quick_sort/quick_sort.py)
- [ ] Kode Merge sort:
- [ ] [Menggunakan keluaran array (C)](http://www.cs.yale.edu/homes/aspnes/classes/223/examples/sorting/mergesort.c)
- [ ] [Menggunakan keluaran array (Python)](https://github.com/jwasham/practice-python/blob/master/merge_sort/merge_sort.py)
- [ ] [Di tempat (C ++)](https://github.com/jwasham/practice-cpp/blob/master/merge_sort/merge_sort.cc)
- [ ] Kode Quick sort:
- [ ] [Implementasi (C)](http://www.cs.yale.edu/homes/aspnes/classes/223/examples/randomization/quick.c)
- [ ] [Implementasi (C)](https://github.com/jwasham/practice-c/blob/master/quick_sort/quick_sort.c)
- [ ] [Implementasi (Python)](https://github.com/jwasham/practice-python/blob/master/quick_sort/quick_sort.py)
- [ ] Implement:
- [ ] Mergesort: O(n log n) average and worst case
- [ ] Quicksort O(n log n) average case
- Selection sort and insertion sort are both O(n^2) average and worst case
- For heapsort, see Heap data structure above.
- [ ] Implementasi:
- [ ] Mergesort: O(n log n) rata-rata dan kasus terburuk
- [ ] Quicksort: O(n log n) kasus rata-rata
- Sortir seleksi dan sortir penyisipan keduanya merupakan kasus rata-rata O (n ^ 2) dan terburuk
- Untuk heapsort, lihat struktur data Heap di atas
- [ ] Not required, but I recommended them:
- [ ] [Sedgewick - Radix Sorts (6 videos)](https://www.youtube.com/playlist?list=PLe-ggMe31CTcNvUX9E3tQeM6ntrdR8e53)
- [ ] [1. Strings in Java](https://www.youtube.com/watch?v=zRzU-FWsjNU&list=PLe-ggMe31CTcNvUX9E3tQeM6ntrdR8e53&index=6)
- [ ] [2. Key Indexed Counting](https://www.youtube.com/watch?v=CtgKYmXs62w&list=PLe-ggMe31CTcNvUX9E3tQeM6ntrdR8e53&index=5)
- [ ] [3. Least Significant Digit First String Radix Sort](https://www.youtube.com/watch?v=2pGVq_BwPKs&list=PLe-ggMe31CTcNvUX9E3tQeM6ntrdR8e53&index=4)
- [ ] [4. Most Significant Digit First String Radix Sort](https://www.youtube.com/watch?v=M3cYNY90R6c&index=3&list=PLe-ggMe31CTcNvUX9E3tQeM6ntrdR8e53)
- [ ] [5. 3 Way Radix Quicksort](https://www.youtube.com/watch?v=YVl58kfE6i8&index=2&list=PLe-ggMe31CTcNvUX9E3tQeM6ntrdR8e53)
- [ ] [6. Suffix Arrays](https://www.youtube.com/watch?v=HKPrVm5FWvg&list=PLe-ggMe31CTcNvUX9E3tQeM6ntrdR8e53&index=1)
- [ ] [Radix Sort](http://www.cs.yale.edu/homes/aspnes/classes/223/notes.html#radixSort)
- [ ] [Radix Sort (video)](https://www.youtube.com/watch?v=xhr26ia4k38)
- [ ] [Radix Sort, Counting Sort (linear time given constraints) (video)](https://www.youtube.com/watch?v=Nz1KZXbghj8&index=7&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb)
- [ ] [Randomization: Matrix Multiply, Quicksort, Freivalds' algorithm (video)](https://www.youtube.com/watch?v=cNB2lADK3_s&index=8&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp)
- [ ] [Sorting in Linear Time (video)](https://www.youtube.com/watch?v=pOKy3RZbSws&list=PLUl4u3cNGP61hsJNdULdudlRL493b-XZf&index=14)
- [ ] Tidak wajib, tetapi saya merekomendasikan mereka:
- [ ] [Sedgewick - Radix Sorts (6 video)](https://www.coursera.org/learn/algorithms-part2/home/week/3)
- [ ] [1. String di Java](https://www.coursera.org/learn/algorithms-part2/lecture/vGHvb/strings-in-java)
- [ ] [2. Penghitungan Indeks Kunci](https://www.coursera.org/learn/algorithms-part2/lecture/2pi1Z/key-indexed-counting)
- [ ] [3. Urutan Radix String Pertama Digit Signifikan Terkecil](https://www.coursera.org/learn/algorithms-part2/lecture/c1U7L/lsd-radix-sort)
- [ ] [4. Urutan Radix String Pertama Digit Paling Signifikan](https://www.coursera.org/learn/algorithms-part2/lecture/gFxwG/msd-radix-sort)
- [ ] [5. Radix Quicksort 3 Arah](https://www.coursera.org/learn/algorithms-part2/lecture/crkd5/3-way-radix-quicksort)
- [ ] [6. Array Suffix](https://www.coursera.org/learn/algorithms-part2/lecture/TH18W/suffix-arrays)
- [ ] [Sortir Radix](http://www.cs.yale.edu/homes/aspnes/classes/223/notes.html#radixSort)
- [ ] [Sortir Radix (video)](https://www.youtube.com/watch?v=xhr26ia4k38)
- [ ] [Sortir Radix, Sortir Counting (waktu linier diberikan batasan) (video)](https://www.youtube.com/watch?v=Nz1KZXbghj8&index=7&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb)
- [ ] [Pengacakan: Penggandaan Matriks, Quicksort, Algoritma Freivalds (video)](https://www.youtube.com/watch?v=cNB2lADK3_s&index=8&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp)
- [ ] [Menyortir dalam Waktu Linear (video)](https://www.youtube.com/watch?v=pOKy3RZbSws&list=PLUl4u3cNGP61hsJNdULdudlRL493b-XZf&index=14)
If you need more detail on this subject, see "Sorting" section in [Additional Detail on Some Subjects](#additional-detail-on-some-subjects)
Sebagai ringkasan, berikut adalah representasi visual dari [15 algoritma pengurutan](https://www.youtube.com/watch?v=kPRA0W1kECg).
Jika Anda membutuhkan detail lebih lanjut tentang subjek ini, lihat bagian "Menyortir" di [Detail Tambahan tentang Beberapa Subjek](#detail-tambahan-tentang-beberapa-subjek)
## Graphs