排序算法和编程 [英] sorting algorithms and programming

查看:80
本文介绍了排序算法和编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以通过选择排序,插入排序,气泡排序对字符进行排序吗?

预先非常感谢...

can we sort the character by selection sort,insertion sort,bubble sort?

Very thanks in advance...

推荐答案

是的,我们可以!有什么问题吗?

-SA
Yes we can! Any questions?

—SA


如果按照您的问题,我们可以使用指定的方法对字符串中的字符进行排序,那么答案是可以的.
If, by your question you mean can we sort character in a string using your specified methods, the answer is yes we can.


当然,字符只是一个无符号整数,因此您可以像对任何整数一样进行排序...结果是否能满足您的意图,这可能是另一个问题.不知道您要对字符进行排序的原因,也许是按字母顺序排列列表?如果是这样,字母的大小写在排序过程中将很重要.
Sure, a character is just an unsigned integer, so you can sort just like any integer... whether the result gets you what you''re intending to do, that may be a different question. Not sure for the reason you''d want to sort characters, maybe to place list in alphabetical order?? If so, the case of the letters would be important in the sort process.


这篇关于排序算法和编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆