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
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
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Array List vs Linked List | Which one should you use??Hash Tables and Hash FunctionsIntroduction to Big O Notation and Time Complexity (Data Structures & Algorithms #7)Introduction to Hash Tables and Dictionaries (Data Structures & Algorithms #13)Map and HashMap in Java - Full Tutorial10,000 Java performance tips over 15 years - what did I learn? by Jack Shirazi14.11 HashMap and HashTable in JavaBig O, Math, Logarithms, Heap, Binary Tree, and Computing Explained with Simple Live ExampleAce the Remote Interview During The Age of COVID-19: Interviewing Workshop with WePay06 - Hash Tables (CMU Intro to Database Systems / Fall 2021)# 112 Internal Working of HashSet in Java | How HashSet works internally in java | Java | RedSysTechAn introduction to structs, traits, and zero-cost abstractions by Tim McLean - Rust KW MeetupWhiteboard Interview with Arrays and Hash Maps - Whiteboard Wednesday# 109 Difference between HashMap and HashSet |Difference between HashSet and HashMap|Java|RedSysTechHow HashMap works in Java? With Animation!! whats new in java8 tutorialHow HashMap works internally || Popular java interview question on collection (HashMap)Abstract Classes and Methods in Java Explained in 7 MinutesJava Strings are Immutable - Here's What That Actually MeansWhat is a HashSet?