Exercise 4.5

Post Reply
Older Dog
Site Admin
Posts: 26
Joined: Fri Nov 13, 2020 8:16 pm

Exercise 4.5

Post by Older Dog »

4-5 [3] The mode of a bag of numbers is the number that occurs most frequently in the set. The set {4, 6, 2, 4, 3, 1} has a mode of 4. Give an efficient and correct algorithm to compute the mode of a bag of n numbers.
So, what is it, a BAG or a SET of numbers? What is the difference between a bag and a set of numbers?
Post Reply