Page 1 of 1

2. An input file contains all the integers from 1 to n exactly once except one missing integer. The n - 1 integers may a

Posted: Sun May 15, 2022 11:52 am
by answerhappygod
2 An Input File Contains All The Integers From 1 To N Exactly Once Except One Missing Integer The N 1 Integers May A 1
2 An Input File Contains All The Integers From 1 To N Exactly Once Except One Missing Integer The N 1 Integers May A 1 (18.72 KiB) Viewed 47 times
2. An input file contains all the integers from 1 to n exactly once except one missing integer. The n - 1 integers may appear in any order. The goal is to find the missing integer. A solution may scan the input only once. (a) Describe a simple solution that requires O(n)-bits memory. (b) Describe a trickier solution that requires (log n)-bits memory