TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Alphabetically sorting business cards

2 点作者 sriramiyer将近 12 年前

1 comment

hm8将近 12 年前
Did you switch over to insertion sort once the stack became more manageable? Personally, I would have used radix sort, while keeping the stack size manageable. This would mean less comparisons, manageable desk space and less effort. Plus selection sort (which is very intuitive when you aren't bound by array/list constraints) becomes really easy. real world example: Before we could set down for a game of poker; more often than not, my friends and I would have to form a complete deck from the many mixed up together. While quick/merge are the fastest comparison sorts, we would prefer doing a radix sort on the suite and then selection sort until cards of the color are sorted out. I think similar strategies would work here as well!
评论 #5866596 未加载