• Feed
  • Discussions
majority-element

majority-element

#majority-element
0 followers·3 articles

majority-element

#majority-element·0 followers·3 articles
majority-element
Yatin batra
Yatin batra
blogs.stackedmind.com·May 08, 2025
May 08, 2025

Finding the Majority Element of an Array in Java

Date: 2024-05-20 This Java Code Geeks article details three methods to find the majority element (appearing more than half the array's size) in a Java array: sorting, using a HashMap, and the Boyer-Moore Voting Algorithm. Each method is explained st...

Discuss
boyer-moore voting algorithm
NIRNAY BEHERA
NIRNAY BEHERA
nyx1on.hashnode.dev·Sep 27, 2023
Sep 27, 2023

Optimizing Algorithms 1: Majority Element

Let's go over to the problem statement quickly. Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array...

Discuss·5 reads
DSA
Sarath Chandra Reddy
Sarath Chandra Reddy
screddy1313.hashnode.dev·Oct 19, 2022
Oct 19, 2022

Leetcode 169. Majority Element

Problem Statement 📑 In order to better understand the problem, first we have to know what is majority element and what are the properties of majority element. Any element that appears more than half of times of length of array, then that element is...

Discuss·4 reads
Coding Interview Preparation
majority-element

Changelog

New steps component and improved accessibility on Hashnode's blog and docs product.

New steps component and improved accessibility on Hashnode's blog and docs product.

Nov 05, 2024·
new

Trending Articles

Understanding Oone Gas and Fees: The Fuel Behind Every Blockchain Transaction.

Patience Uyire·55 reads

SolvBTC Rolls Out a Next-Gen Platform for Secure, Scalable, and Transparent Bitcoin DeFi

Wissy Ak·45 reads

SolvBTC, 안전하고 확장 가능하며 투명한 비트코인 디파이 플랫폼 출시

Wissy Ak·35 reads

Top commenters this week

Writing Challenges

#2Articles1Week Challenge

Become better at technical writing; accept Hashnode's writing challenge for four weeks.

#2Articles1Week Challenge
#WomenWhoTech

Share your story, achievements, or experiences as a woman, non-binary folk in tech or as a #WomenWhoTech ally!

#WomenWhoTech
Self Starter

Publish your first article on Hashnode and become a self starter!

Self Starter
Serial Blogger

Publish an article every day for 7 days and earn a cool serial blogger badge!

Serial Blogger
Talk of the town

Write a story that drives amazing engagement on Hashnode and become the talk of the town!

Talk of the town
Word Warrior

Write an in-depth article on your Hashnode blog that's more than 2000 words and become a word warrior!

Word Warrior
Lyn Alden
Lyn Alden
alejandro saenz
alejandro saenz
Teresa Jesse
Teresa Jesse
Legit or not
Legit or not
Paul Henson
Paul Henson