Design a number (ID) generator system that generates numbers between 0-99999999 (8-digits). The system should support two
Question:
Design a number (ID) generator system that generates numbers between 0-99999999 (8-digits).
The system should support two functions:
a. int getNumber();
b. boolean requestNumber();
getNumber() function should find out a number that is not assigned, then mark it as assigned and return that number. requestNumber()
function checks the number if it is assigned or not. If it is assigned returns false, else marks it as assigned and return true.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Problems Solving In Data Structures And Algorithms Using C++
ISBN: 9789356273177
2nd Edition
Authors: Hemant Jain
Question Posted: