Andrew Healey 4/30/2019

Fun With Linear Time: My Favorite Algorithm

Read Original

This article details the Boyer-Moore majority vote algorithm (MJRTY), an efficient approach to find the majority element in a list using O(n) time and O(1) space. It contrasts a naive dictionary-based solution with the improved algorithm, provides Python code examples, and discusses the algorithm's history and humorous original paper from 1980.

Fun With Linear Time: My Favorite Algorithm

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet