India’s Best Job Seekers and Training Platform Forums Data Structure There are numbers in between 0-9999999999 (10-digits) which are …

  • There are numbers in between 0-9999999999 (10-digits) which are …

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

    Administrator
    at

    There are numbers in between 0-9999999999 (10-digits) which are assigned someone (does not matter which number assigned who)
    Write two methods called “getNumber” and “requestNumber” as follows
    Number getNumber();
    boolean requestNumber(Number number);
    getNumber method should find out a number that did not assigned than marks it as assigned and return that number.
    requestNumber method checks the number is assigned or not. If it is assigned returns false, else marks it as assigned and return true.
    Design a data sturucture to keep those numbers and implement those methods.

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