- Joined
- Dec 24, 2013
- Messages
- 394
Rep Bank
$790
$790
User Power: 75%
And realized that the manner he was switching the keys resembled sorting an array.
The keys are arranged in columns of four (4) up to seven (7) rows. Each key is identified with a numeric index; ideally, they are arranged in order. Sometimes, work gets hectic: as keys come in and out, new keys with larger numeric indices may become inserted at the first space available, leaving the rows unsorted. Therefore, the manager gets mad and has to sort the keys again (or I do it, because I become equally as mad).
However, as I observed him switching - or, sorting - the keys, it resembled a technique called insertion sort. The keys are nearly sorted, and thankfully not randomly ordered. As a result, this technique is faster than methods such as heap sort which would have better average-case performance (and worst-case performance) than insertion sort for random containers (and even clearer, reversed containers).
I forget: Here's a pythonic program I wrote demonstrating this. Try it out with various arrays. Here's the main program you use.
The keys are arranged in columns of four (4) up to seven (7) rows. Each key is identified with a numeric index; ideally, they are arranged in order. Sometimes, work gets hectic: as keys come in and out, new keys with larger numeric indices may become inserted at the first space available, leaving the rows unsorted. Therefore, the manager gets mad and has to sort the keys again (or I do it, because I become equally as mad).
However, as I observed him switching - or, sorting - the keys, it resembled a technique called insertion sort. The keys are nearly sorted, and thankfully not randomly ordered. As a result, this technique is faster than methods such as heap sort which would have better average-case performance (and worst-case performance) than insertion sort for random containers (and even clearer, reversed containers).
I forget: Here's a pythonic program I wrote demonstrating this. Try it out with various arrays. Here's the main program you use.
Dislike ads? Become a Fastlane member:
Subscribe today and surround yourself with winners and millionaire mentors, not those broke friends who only want to drink beer and play video games. :-)
Membership Required: Upgrade to Expose Nearly 1,000,000 Posts
Ready to Unleash the Millionaire Entrepreneur in You?
Become a member of the Fastlane Forum, the private community founded by best-selling author and multi-millionaire entrepreneur MJ DeMarco. Since 2007, MJ DeMarco has poured his heart and soul into the Fastlane Forum, helping entrepreneurs reclaim their time, win their financial freedom, and live their best life.
With more than 39,000 posts packed with insights, strategies, and advice, you’re not just a member—you’re stepping into MJ’s inner-circle, a place where you’ll never be left alone.
Become a member and gain immediate access to...
- Active Community: Ever join a community only to find it DEAD? Not at Fastlane! As you can see from our home page, life-changing content is posted dozens of times daily.
- Exclusive Insights: Direct access to MJ DeMarco’s daily contributions and wisdom.
- Powerful Networking Opportunities: Connect with a diverse group of successful entrepreneurs who can offer mentorship, collaboration, and opportunities.
- Proven Strategies: Learn from the best in the business, with actionable advice and strategies that can accelerate your success.
"You are the average of the five people you surround yourself with the most..."
Who are you surrounding yourself with? Surround yourself with millionaire success. Join Fastlane today!
Join Today