Question
A company uses drones to deliver its products. Each delivery is assigned a unique ID; a positive integer. When a drone takes off for delivery,
A company uses drones to deliver its products. Each delivery is assigned a unique ID; a positive integer. When a drone takes off for delivery, the delivery ID is added to a list (array). When the drone returns, the ID is again added to the same list. One drone has gone missing, so its ID was not added to the list a second time. Given the list of IDs, which contains many duplicate integers and one unique integer, find the unique integer. IDs are NOT guaranteed to be sorted or sequential. Examples: findMissing([1,2,3,4,1,2,4]) //=> 3 findMissing([100,33,27,89,27,99,33,99,100]) //=> 89 a. Write the algorithm in pseudocode in c++ b. Implement your solution in c++ c. What is the time complexity of your solution (Big-O)?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started