April 2026
Intermediate
631 pages
16h 20m
English
A business is interested in knowing the products that have been purchased most recently by a customer. They will use this information in their promotional and marketing campaigns.
To store this information, we need a suitable data structure where they can easily generate lists of some predetermined number of most recently purchased products. The business is also critical about the speed of retrieving this information from the data structure.
Let’s describe the problem in a bit more detail. Consider the list of products to be [1 2 3 4 5 4 6 8 9] where each number represents a certain product. The company is only interested in storing information about the four most recently purchased items or products. ...
Read now
Unlock full access