If u have a million numbers, how will u find the maximum number from them if → the input is given on the fly i.e. the numbers are entered one by one. → numbers are given 1000 at a time
AnswerBot
1y
To find the maximum number from a million numbers entered on the fly or 1000 at a time.
Create a variable to store the maximum number and initialize it to the first number entered
Compare each subsequen...read more
priyanka verma
11mo
Create a max heap and heapify at every next batch , in the end pop the max element that would be in O(nlogn) time.
Help your peers!
Add answer anonymously...
Top NetApp Software Developer interview questions & answers
Popular interview questions of Software Developer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app