TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Alphabetically sorting business cards

2 pointsby sriramiyeralmost 12 years ago

1 comment

hm8almost 12 years ago
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 未加载