filmov
tv
CP-1.011 Java Tutorial - Traversing a Map
Показать описание
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.
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.