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

1
The Beautiful Web
Jens Oliver Meiert 2 votes
3
LLM Use in the Python Source Code
Miguel Grinberg 1 votes
4
Wagon’s algorithm in Python
John D. Cook 1 votes