著名外企面试题一道,关于排序,英文题目,欢迎讨论。(100分)

zpengyu 2007-11-29 06:41:06
In 1983 a hot topic was the new "genius" bubble-sort algorithm. To sort a long list or array, you just traversed it and compared items 2 and 2. If the smaller one was after the bigger one, you swapped them.
This traversal was repeated until the items were sorted (no swap happened). Nowadays, bubble-sort is never heard of.
• Explain why and when bubble-sort is an inefficient sorting algorithm.
• Implement another sorting algorithm you find to be efficient.
• Document your sorting algorithm, what does it do, how and why is it efficient? The objects to sort should be arbitrarily long strings of 8 bit ASCII characters. The input is an unsorted list of such strings.
Use C, C++, Java or any other language, which we might reasonably be expected to understand. We expect you to write the complete code, i.e. don't use pre-defined libraries or language implementations with built-in hash functions. Also, we expect you to write the code yourself, although using books etc, as aid is not by any means prohibited.
...全文
371 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
goodmrning 2008-01-05
  • 打赏
  • 举报
回复
接分
goodmrning 2008-01-05
  • 打赏
  • 举报
回复
路过
goodmrning 2008-01-05
  • 打赏
  • 举报
回复
强!!!!!!!!!!!!!!
goodmrning 2008-01-05
  • 打赏
  • 举报
回复
帮楼主顶下!!!!!!!!!!!!!!
dmhaifeng 2008-01-05
  • 打赏
  • 举报
回复
冒泡的效率的确不怎么地!!!
grellen 2008-01-05
  • 打赏
  • 举报
回复
mark
xiaobukuai 2007-12-01
  • 打赏
  • 举报
回复
mark
pptor 2007-11-29
  • 打赏
  • 举报
回复
In 1983 a hot topic was the new "genius" bubble-sort algorithm. //冒泡排序
To sort a long list or array/*排序数组或列表*/,
you just traversed it and compared items 2 and 2.//2个2个的对比
If the smaller one was after the bigger one, you swapped them. //小的在后,进行交换
This traversal was repeated until the items were sorted (no swap happened).
Nowadays, bubble-sort is never heard of.
? Explain why and when bubble-sort is an inefficient sorting algorithm.//why when 冒泡法效率低
? Implement another sorting algorithm you find to be efficient.//写意个效率高的排序
? Document your sorting algorithm, what does it do, how and why is it efficient? //解释你的排序算法,怎么工作,时间复杂度和空间复杂度
The objects to sort should be arbitrarily long strings of 8 bit ASCII characters.//用这个算法排序任意长度的字符串
The input is an unsorted list of such strings.//输入未排序的字符串
Use C, C++, Java or any other language, //语言
which we might reasonably be expected to understand.
We expect you to write the complete code, //写完整的代码
i.e. don't use pre-defined libraries or language
implementations with built-in hash functions. Also, we expect you to write the code yourself, //自己的代码
although using books etc, as aid is not by any means prohibited.

33,007

社区成员

发帖
与我相关
我的任务
社区描述
数据结构与算法相关内容讨论专区
社区管理员
  • 数据结构与算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧