India’s Best Job Seekers and Training Platform Forums Data Structure Create the data structure for a component that will receive a series …

  • Create the data structure for a component that will receive a series …

     Akash  updated 1 year, 2 months ago 1 Member · 1 Post
  • Akash 

    Administrator
    at

    Create the data structure for a component that will receive a series of numbers over the time and, when asked, returns the median of all received elements.
    (Median: the numerical value separating the higher half of a data sample from the lower half. Example: if the series is
    2, 7, 4, 9, 1, 5, 8, 3, 6
    then the median is 5.)
    Model the data structure for a component that would have these two methods:
    @interface SampleHandler {
    – (void)addNumber:(NSNumber*)number;
    – (NSNumber*)median;
    }
    Justify your decisions. Calculate the complexity of each method.

Log in to reply.

Original Post
0 of 0 posts June 2018
Now

New Report

Close