- 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.
推薦閱讀
- 少兒人工智能趣味入門:Scratch 3.0動(dòng)畫與游戲編程
- 深入理解Java7:核心技術(shù)與最佳實(shí)踐
- Visual Basic程序設(shè)計(jì)與應(yīng)用實(shí)踐教程
- 自然語(yǔ)言處理Python進(jìn)階
- Symfony2 Essentials
- Extending Puppet(Second Edition)
- Python深度學(xué)習(xí):模型、方法與實(shí)現(xiàn)
- 從零開(kāi)始學(xué)C#
- Struts 2.x權(quán)威指南
- 從零開(kāi)始學(xué)Android開(kāi)發(fā)
- ASP.NET開(kāi)發(fā)寶典
- Java語(yǔ)言程序設(shè)計(jì)實(shí)用教程(第2版)
- Professional JavaScript
- Go Systems Programming
- Python無(wú)監(jiān)督學(xué)習(xí)