Problem: Warehouse (https://open.kattis.com/problems/ware...)
For this question, I am using TreeMap and TreeSet which are sorted (vs. HashMap/HashSet). If you are new to maps and sets, there's actually quite a lot in this video, so that's why I went a bit slow.
Most importantly, I went through a couple of ways to traverse through a map, which is something I didn't do in the previous video on maps. It is definitely something that you will often be doing when solving these coding problems.
Previous video on maps: • CP-1.007 Java Tutorial - HashMap
Previous video on sets: • CP-1.006 Java Tutorial - HashSet
Video Sections:
0:00 - Problem description and how we are going to solve it
3:07 - Start of solution (mapping item to frequency)
8:19 - Sorting a map
12:17 - Reversing the map (mapping frequency to item)
19:56 - Printing the map
24:50 - Summary
Please note that all views and opinions expressed in this video are my own and does not reflect that of Kattis or any other person/organisation mentioned in the video.
On this page of the site you can watch the video online CP-1.011 Java Tutorial - Traversing a Map with a duration of hours minute second in good quality, which was uploaded by the user Daniel Sutantyo 15 September 2021, share the link with friends and acquaintances, this video has already been watched 471 times on youtube and it was liked by 12 viewers. Enjoy your viewing!