快速排序简介_排序简介

快速排序简介

Sorting is nothing but arranging the data in ascending or descending order. The term sorting came into picture, as humans realised the importance of searching quickly.

排序只不过是按升序或降序排列数据。 随着人们意识到快速搜索的重要性, 分类一词成为了现实。

There are so many things in our real life that we need to search for, like a particular record in database, roll numbers in merit list, a particular telephone number in telephone directory, a particular page in a book etc. All this would have been a mess if the data was kept unordered and unsorted, but fortunately the concept of sorting came into existence, making it easier for everyone to arrange data in an order, hence making it easier to search.

在现实生活中,我们需要搜索的东西太多了,例如数据库中的特定记录,绩效列表中的卷号,电话簿中的特定电话号码,书中的特定页面等。如果数据保持无序和无序的混乱,那么幸运的是, 排序的概念应运而生,这使每个人都更容易按顺序排列数据,从而使搜索变得更加容易。

Sorting arranges data in a sequence which makes searching easier.

排序将数据按顺序排列,这使搜索更加容易。

分选效率 (Sorting Efficiency)

If you ask me, how will I arrange a deck of shuffled cards in order, I would say, I will start by checking every card, and making the deck as I move on.

如果您问我,我将如何按顺序排列一副打乱的纸牌,我会说,首先要检查每张纸牌,然后继续前进。

It can take me hours to arrange the deck in order, but that's how I will do it.

我可能需要几个小时才能整理好甲板,但这就是我要做的。

Well, thank god, computers don't work like this.

好吧,谢天谢地,计算机无法像这样工作。

Since the beginning of the programming age, computer scientists have been working on solving the problem of sorting by coming up with various different algorithms to sort data.

自编程时代开始以来,计算机科学家就一直在通过提出各种不同的算法对数据进行排序来解决排序问题。

The two main criterias to judge which algorithm is better than the other have been:

判断哪种算法优于其他算法的两个主要标准是:

  1. Time taken to sort the given data.

    对给定数据进行排序所花费的时间。

  2. Memory Space required to do so.

    这样做所需的内存空间。

不同的排序算法 (Different Sorting Algorithms)

There are many different techniques available for sorting, differentiated by their efficiency and space requirements. Following are some sorting techniques which we will be covering in next few tutorials.

有许多不同的技术可用于分类,它们的效率和空间要求有所不同。 以下是一些排序技术,我们将在接下来的一些教程中介绍它们。

  1. Bubble Sort

    气泡排序

  2. Insertion Sort

    插入排序

  3. Selection Sort

    选择排序

  4. Quick Sort

    快速排序

  5. Merge Sort

    合并排序

  6. Heap Sort

    堆排序

Although it's easier to understand these sorting techniques, but still we suggest you to first learn about Space complexity, Time complexity and the searching algorithms, to warm up your brain for sorting algorithms.

尽管更容易理解这些排序技术,但是仍然建议您首先了解空间复杂度时间复杂度搜索算法 ,以使您的大脑为排序算法热身。

翻译自: https://www.studytonight.com/data-structures/introduction-to-sorting

快速排序简介

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值