These algorithms are not always faster than comparison-based sorts. They take extra space for auxiliary arrays and their performance depends heavily on the distribution of data. Understanding when to trade space for speed is key to choosing the right tool for the job.
#sorting
Radix Sort is particularly effective for handling large ranges of elements. It utilizes Counting Sort as a core routine, performing d passes (d is the number of digits in the maximum element) to sort the array based on individual digit positions. That makes it O(d*(n+b)).
I spent time today studying Counting Sort and Radix Sort. It’s so cool how these non-comparison sorting algorithms can achieve linear time complexity, O(n+k), while traditional comparison based algorithms cap at O(nlogn).
For instantiation: Avoid using new inside smart pointers. Use std::make_unique and std::make_shared instead.
Why?
Exception safety: avoids leaks with exception.
Performance: std::make_shared combines the control block and the object into a single heap allocation instead of two.
What if a resource needs multiple owners? That’s where std::shared_ptr comes in. It uses reference counting to keep the resource alive until the last ptr is destroyed.
But beware of circular dependencies! Solved using std::weak_ptr. It just observes the resource, no ownership.
most people don’t fail because they’re stupid.
they fail because they live in demo mode.
they read. they watch. they save tabs. they nod along.
nothing ever compiles. nothing ever ships.
the brain rewards recognition the same way it rewards achievement.
so people confuse understanding with progress.
real learning hurts.
real building breaks things.
real thinking forces you to admit you were wrong yesterday.
that’s why most people stay theoretical forever.
theory never humiliates you.
execution does.
and humiliation is the tuition fee for competence.
211K Followers 492 Following- Head of DevRel Engineer at https://t.co/t5PMw0nLYM
- Software Developer
- Rust, Docker, Web Dev
- Docker Captain
- Keynote Speaker
- Building a 1M community...66%
6K Followers 27 FollowingSovereign AI for enterprises. Build AI you own on infrastructure you control. Private, specialized models that run where your data lives.
211K Followers 3K FollowingFollow for posts about GitHub repos, DSPy, and agents
Subscribe for top posts
DM to share your AI project (Due to volume of DMs I'll prioritize subscribers)
73K Followers 735 FollowingLooking for the latest in Tech? Follow @TWiT - Tech podcasts with @leolaporte, @mikahsargent, and friends. Get extras at https://t.co/vJKBWWeYmx
1.3M Followers 232 FollowingWe develop, demonstrate, and infuse transformational technologies that enhance NASA’s efforts to explore the unknown in space and benefit life on Earth.
164K Followers 12 FollowingFollow what the CEOs and other executives from tech companies do on X. DMs open for feedback and requests. Powered by @Kalshi
56K Followers 2K FollowingTurning Cloud & AI into actionable insights through visuals. 🛠️
Architecting 2026 with 56k+ engineers | Level up your skills.
📥 DMs open for partnerships.
714K Followers 470 FollowingWhat you want to know about tech. A section of @thisisinsider. Follow us on Facebook, Instagram, and YouTube. Visit our homepage for the day's top stories.