- ตัวดำเนินการ
-
เรียนรู้
ศูนย์การเรียนรู้ Python ตัวอย่างที่รันได้, NumPy, pandas และอื่น ๆ ศูนย์การเรียนรู้ C และ C++ พอยน์เตอร์ หน่วยความจำ STL และ C++ สมัยใหม่ ศูนย์การเรียนรู้ C#พื้นฐาน C#, OOP, LINQ, async และแบบฝึกหัด .NET อัลกอริทึม Python การค้นหา การเรียงลำดับ รีเคอร์ชัน และภาพจำลอง O(n) อัลกอริทึม C และ C++ เปรียบเทียบการเขียนด้วย C และ C++
- โจทย์
Visualizers
Sorting Algorithm Visualizer
See how classic sorting algorithms work, one comparison and swap at a time.
- Runs in your browser
- Instant results
- Free, no sign-up
Loading the tool…
How to use the Sorting Algorithm Visualizer
- Choose an algorithm, the number of elements and the starting data.
- Press Play, or Step to go one operation at a time.
- Compare comparisons, swaps and the complexity table between algorithms.
Frequently asked questions
Which sorting algorithm is fastest?
On random data, quick, merge and heap sort (O(n log n)) beat the O(n²) sorts. Insertion sort wins on nearly sorted data.
What does stable mean?
A stable sort keeps equal values in their original order, which matters when sorting records by one field.
Why try different starting data?
Some algorithms behave very differently on sorted, reversed or repetitive input; quick sort's worst case shows on sorted data.
ฝึก Python ด้วยโจทย์เขียนโค้ด
แก้โจทย์จริงใน editor นี้: รันทดสอบตัวอย่าง ส่งคำตอบ และรับรีวิวโค้ดจาก AI