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...
NetApp Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
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

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter