Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Why continue using the frequencyMap if we already have the frequency in the Element class?

CaptainKidd

May 10, 2023

Could we not just check the frequency there and decrement and if it's 0 not push it back onto the heap?

0

0

Comments
Comments
S
Silencer312 2 years ago

How would you do push operations and increase the frequency of a number already in the stack?