India’s Best Job Seekers and Training Platform Forums Data Structure You will be given a stream of integers, and a integer k for window size …

  • You will be given a stream of integers, and a integer k for window size …

     Akash  updated 10 months, 2 weeks ago 1 Member · 1 Post
  • Akash 

    Administrator
    at

    You will be given a stream of integers, and a integer k for window size, you will only receive the streams integers one by one. whenever you receive an integer, you have to return the maximum number among last k integers inclusive of current entry.
    Interviewer was expecting O(N) solution for N asks.
    Edits: Interviewer was expecting O(N) Time + O(1) avg case space complexity solution for N asks.
    and integers are not given in a array, every time only one integer will be passed as input to your method.

Log in to reply.

Original Post
0 of 0 posts June 2018
Now
KodNest Training New Batch is starting on 21st September 2020. Attend one week free demo classes.Register Now

New Report

Close