Загрузка страницы

Simple Explanation of HashMap, HashSet, ArrayLists and Big O: O(n), O(1)

An explanation of algorithm growth rates (Big O) and different collection types: HashMap, HashTable, and ArrayList. In this video, I show how ArrayList fetch and insert at the beginning operations have O(n) growth rate performance, while the add, remove, contains, and size operations of a HashSet/HashMap have a more preferable constant, or O(1) performance. I explain how this works: through HashCodes, and what a hash code is. I perform a live example by showing a magnet collection, stored in a theoretical array, versus stored in a HashMap.

Hashcode Details from this video example:
New Zealand :: -244247871
Queens :: -1864844631
Isle of Man :: 449363438
London :: -2013264328
Coventry :: -287223480
Rio :: 82168
Monterrey :: 702301905
Peru :: 2483992
Zurich :: -1606791497
Sydney :: -1803913660
R: 82
i: 105
o: 111
Space 0 :: -2013264328 :: -1819295312
Space 1 :: -1819295312 :: -1625326296
Space 2 :: -1625326296 :: -1431357280
Space 3 :: -1431357280 :: -1237388264
Space 4 :: -1237388264 :: -1043419248
Space 5 :: -1043419248 :: -849450232
Space 6 :: -849450232 :: -655481216
Space 7 :: -655481216 :: -461512200
Space 8 :: -461512200 :: -267543184
Space 9 :: -267543184 :: -73574168
Space 10 :: -73574168 :: 120394848
Space 11 :: 120394848 :: 314363864
Space 12 :: 314363864 :: 508332880
Space 13 :: 508332880 :: 702301896

Source code is freely available on GitHub: https://github.com/discospiff/SpringBootMicroservicesWithIntelliJIDEA

This video is part of a playlist on Microservices and Spring Boot with IntelliJ IDEA: https://www.youtube.com/watch?v=6vvUevxlOp8&list=PL73qvSDlAVVhr2V85gxReq9PUptNaVI9M

Видео Simple Explanation of HashMap, HashSet, ArrayLists and Big O: O(n), O(1) канала Brandan Jones
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
21 сентября 2020 г. 4:23:16
00:14:59
Яндекс.Метрика