- Go Systems Programming
- Mihalis Tsoukalos
- 183字
- 2021-07-02 18:08:05
Sorting algorithms
The most common category of algorithm has to deal with sorting data, that is, placing it in a given order. The two most famous sorting algorithms are the following:
- Quicksort: This is considered one of the fastest sorting algorithms. The average time that quicksort takes to sort its data is O (n log n), but this can grow up to O(n2) in the worst-case scenario, which mainly has to do with the way the data is presented for processing.
- Bubble sort: This algorithm is pretty easy to implement with an O(n2) average complexity. If you want to start learning about sorting, start with bubble sort before looking into the more difficult to develop algorithms.
Although every algorithm has its disadvantages, if you do not have lots of data, the algorithm is not really important as long as it does the job.
What you should remember is, the way Go implements sorting internally cannot be controlled by the developer and it can change in the future; so, if you want to have full control over sorting, you should write your own implementation.
推薦閱讀
- Learning Scala Programming
- 深入淺出Java虛擬機:JVM原理與實戰
- PyQt從入門到精通
- 三維圖形化C++趣味編程
- Neo4j Essentials
- Mastering PHP Design Patterns
- concrete5 Cookbook
- Mastering JBoss Enterprise Application Platform 7
- 利用Python進行數據分析(原書第3版)
- Symfony2 Essentials
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(1)
- Serverless computing in Azure with .NET
- Multithreading in C# 5.0 Cookbook
- 精通MySQL 8(視頻教學版)
- 零基礎學Python編程(少兒趣味版)