If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
Exemplary tutorial, as always. Timings + my notes below that might help others: 1:45 An example of how hashmaps can help 2:05 Creating and naming a hashmap 2:40 How to add values to a hashmap using the .put method 3:52 Why you should use a generic and data type for type safety when creating a hashmap + how to add this 4:25 Why you need 'Integer' [i.e. class type] for a hashmap (can't take primitive 'int' type) 5:00 Test print of hashmap (default output displays in set notation) 5:30 Calling a specific value from the hashmap - .get call 5:50 Start of more advanced hashmap functions - user + password example 6:15 Creating a hashmap with specific type for type safety 6:33 How to add users and passwords - .put method 7:32 How to remove elements from a hash map - .remove method 8:08 Check if hashmap contains a specific value - .containsValue 8:42 Difference between Values and Keys in a hashmap using .containsValue and .containsKey method calls 9:23 How to replace a value (password) - .replace method 10:10 Key difference between hashmaps and array lists - hashmaps don't have a specific order whereas array lists have an index 11:00 Simple summary of what a hashmap is
Yes the name itself used to make me think that this HashMap thing is one of the most complicated things in Java. Your tutorial made it look like a piece of cake. :) Thanks! keep up the good work.
It’s not complicated to use but the implementation of a hash map is a bit more complex than just a 2d array. Hashmaps use a hash function to store the key value pair so that it doesn’t have to go through the whole hashmap using a for loop, Big O(n), when looking for a key. The hash function lookup makes it so that it is Big O(1). In other words the hash function makes it so that the lookup of a key is faster.
2:00 It's called HashMap because it uses hash key to access values in the background and implements Map interface and extends AbstractMap class. If you would write your custom HashMap it would be array of linked lists. Length of the array would not be equal to number of stored key-value pairs. Instead array stores linked list heads, where each list node has hash key, value and points to next node. Hash key is hash version of the key you inserted. To access the value nodes are iterated until hash key matches.
I don't know if you'll see this since it's an older video but you're probably the only programming tutorial RUclipsr that's relatable. The rest of them are super smart and do know what they're talking about (so are you obviously) but for some reason, you admitting that a certain topic or part of a topic confuses you helps me understand the material more when you explain it.
i have watched too many java channels but i found you is the best the best thing about is you is you start to explain a topic in such a way that nothing more required to learn that perticular topic. please bother upload all the java tutorials like spring mvc swings etc.
I was working on a master order assignment where we had to make a map of cookie variety and its numBoxes sold. This video was very helpful since he basically said, here is the assignment. You're gonna need to know Maps. I appreciate the tutorials. Thank you so much.
Seriously you taught a semestre worth of studies under 20 min. I thank you. I couldn't figure this out until your video. Please make more videos on data structures. I get your explanations.
In a technical aptitude exams hashing question were asked ..had no idea what hashing was and didn't do well but now it is crisp and clear thanks to u Sir..
Hello Alex and thank you very much for your videos. They are awesome! For this video in particular, it was not clear to me what are the differences of HashMap and ArrayList, and how too choose which to use. Thank you again!
Dude, thank you so much for this video! I'm 2 years into a computer science degree program and this is the first explanation of a hash map that has made sense to me!
If you are 2 years into a computer science degree and you do not understand the basics of search time algorithms or hashing then either cut your losses and leave or find another service provider
This was extremely helpful in helping me understand hashmaps. I wasn't understanding them in lectures but this definitely helped clear things up. Thanks!!!
thanks a lot i solved the follow program only bcoz of ur help.....FIRST ONE is the one with warning and error code as following......Note: HelloWorld.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details..........SECOND ONE is correct one... FIRST CODE WITH WARNING import java.util.*; public class HelloWorld { public static void main(String[] args) { HashMap map = new HashMap();/"line with warning"/ map.put("Father", "Rob"); map.put("Mother", "Kirsten"); System.out.println(map.toString()); } } SECOND CODE WITHOUT WARNING(thanks to you) import java.util.*; public class HelloWorld { public static void main(String[] args) { HashMap map = new HashMap();/"this time no warning"/ map.put("Father", "Rob"); map.put("Mother", "Kirsten"); System.out.println(map.toString()); } }
Great video Alex, I have a quick question for you. At 3:22 you type happy.put("a", 10). Wouldn't 10 in this case be a magic number? Shouldn't that line be happy.put("a", a)?
It was originally used in cryptology as method of assigning a key that is generated using a underlying algorithm and thus this key is then used to place the value into a data structure that can be retrieved. From this it was used because the second and most commonly used reason now is to reduce the search time complexity from O(n), O(n^2) and so on; to O(1). The hash value is the return value of the function that used to generate that hash value and is used as the index positioning of the element and hence used as a key
Alex you connect really well with your audience. Also about such subjects, I always used to think that i wont understand.. But after watching my first video, the perception has been changed. Please continue making contents. All the best to you. :)
Ivbeen stressing out over this for days cuz of my final. Learned it conpletely under 12 min just now. Just need some practice and the final is gonna be ez. thanks bud!
If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
Exemplary tutorial, as always. Timings + my notes below that might help others:
1:45 An example of how hashmaps can help
2:05 Creating and naming a hashmap
2:40 How to add values to a hashmap using the .put method
3:52 Why you should use a generic and data type for type safety when creating a hashmap + how to add this
4:25 Why you need 'Integer' [i.e. class type] for a hashmap (can't take primitive 'int' type)
5:00 Test print of hashmap (default output displays in set notation)
5:30 Calling a specific value from the hashmap - .get call
5:50 Start of more advanced hashmap functions - user + password example
6:15 Creating a hashmap with specific type for type safety
6:33 How to add users and passwords - .put method
7:32 How to remove elements from a hash map - .remove method
8:08 Check if hashmap contains a specific value - .containsValue
8:42 Difference between Values and Keys in a hashmap using .containsValue and .containsKey method calls
9:23 How to replace a value (password) - .replace method
10:10 Key difference between hashmaps and array lists - hashmaps don't have a specific order whereas array lists have an index
11:00 Simple summary of what a hashmap is
:D
Thank you for this!
This is actually the best description of HashMaps I have seen yet
Yes the name itself used to make me think that this HashMap thing is one of the most complicated things in Java. Your tutorial made it look like a piece of cake. :) Thanks! keep up the good work.
It’s not complicated to use but the implementation of a hash map is a bit more complex than just a 2d array. Hashmaps use a hash function to store the key value pair so that it doesn’t have to go through the whole hashmap using a for loop, Big O(n), when looking for a key. The hash function lookup makes it so that it is Big O(1). In other words the hash function makes it so that the lookup of a key is faster.
This video is awesome. Your english is clear and understandable. I like it 👍
Here, after concentrating to get what was said in the Indian accent, one time too often.
@@7own878 it gets tiring to heat the same accent from computer science tutorials all the time
I know...we can actually understand this man, unlike all the other idiots who make tutorials
2:00 It's called HashMap because it uses hash key to access values in the background and implements Map interface and extends AbstractMap class.
If you would write your custom HashMap it would be array of linked lists. Length of the array would not be equal to number of stored key-value pairs. Instead array stores linked list heads, where each list node has hash key, value and points to next node. Hash key is hash version of the key you inserted. To access the value nodes are iterated until hash key matches.
I don't know if you'll see this since it's an older video but you're probably the only programming tutorial RUclipsr that's relatable. The rest of them are super smart and do know what they're talking about (so are you obviously) but for some reason, you admitting that a certain topic or part of a topic confuses you helps me understand the material more when you explain it.
He understands what not knowing something was like. I really appreciate that!
i have watched too many java channels but i found you is the best the best thing about is you is you start to explain a topic in such a way that nothing more required to learn that perticular topic. please bother upload all the java tutorials like spring mvc swings etc.
Best hashmapping tutorial! super easy to understand well delivered! more tutorials to come THANKS! :D
This is so helpful. Your explanations and presentation are perfect.
Love your tutorials, so clear and concise! you just get to the point and it just makes sense!
For anyone with a python background, hashmaps are the same as dictionaries.
Thank you bigman
Yes
Thank you
Ah the more you know.
Saved me 11 minutes !
I was working on a master order assignment where we had to make a map of cookie variety and its numBoxes sold. This video was very helpful since he basically said, here is the assignment. You're gonna need to know Maps. I appreciate the tutorials. Thank you so much.
So glad to see how your channel has grown over time. You really deserve it!
I wonder how many people, beside me, who graduated IT thanks to you and John. I appreciate you.
I loved the names haha "happy" and "fun", thank you so much for your explanation you made easier to understand
Seriously you taught a semestre worth of studies under 20 min. I thank you. I couldn't figure this out until your video. Please make more videos on data structures. I get your explanations.
just as simple as u.thanks.it is a one kind of social work.we need people like u.
The UI you created it beautiful!
You make everything so simple. Thanks a lot !
In a technical aptitude exams hashing question were asked ..had no idea what hashing was and didn't do well but now it is crisp and clear thanks to u Sir..
Thank you very much Alex! I was struggling with HashMap for all day, and your video really helped!!
Thank you for explaining things so well. You make otherwise complicated things sound so easy to understand. Bless you brother!
Most useful on teaching me hashmaps, Thank you so much!
I finally understood, thanks for the video!! Btw the sound of your keyboard is so satisfying😨
now that's amazing how something so abstract to me has become instantly crystal clear. you are awesome!
This young dude is my favorite tutor in youtube !!
Couldnt imagine a better tutorial out there!
Great Video man!
Been studying for my Software Engineering Interview, and these videos are so helpful!
You are great my son. May God Bless you.I am 48 but steel I am your student. Thank you very much.
the most simplified yet extremely informative tut on hashmap. great work m8 :)
That keyboard is amazing! Thanks for clearing up hashmaps for me, makes it easier when we get there at school.
for anyone that is wondering, it is called a HashMap because it uses a technique called hashing.
love the teachers who make understanding fun. thank you sir
lovely dialogue delivering, excellent quality of video, concepts told in lay man terms. enjoyed and learnt. keep up the good work Alex. :)
Hello Alex and thank you very much for your videos. They are awesome!
For this video in particular, it was not clear to me what are the differences of HashMap and ArrayList, and how too choose which to use.
Thank you again!
Thank you for the video. This covers almost everything for novice learners.
Dude, thank you so much for this video! I'm 2 years into a computer science degree program and this is the first explanation of a hash map that has made sense to me!
If you are 2 years into a computer science degree and you do not understand the basics of search time algorithms or hashing then either cut your losses and leave or find another service provider
@@richardpaynton8766 I appreciate the advice, but I only have 1 term left now until I graduate. But yes, my teacher was terrible.
thank you for making coding tutorials that arent mind numbing
Your Videos are straight to the point , My Coding phobia isn't anymore because of your videos...
I finally understand HashMaps. Thank you so much!
you don't give weird analogies like other youtube videos good work
Thank you ❤
Your videos are very easy to follow !
This was extremely helpful in helping me understand hashmaps. I wasn't understanding them in lectures but this definitely helped clear things up. Thanks!!!
i don't usually write comments but your tutorials are so good and helpful.
keep going !
Teaching method really awesome. Wish your good health.
great tutorial. I understand it alot than my teacher. Thanyou! post more java tutorial
These tutorials are awesome. You make java look so easy. Thanks for these easy tutorials!!
Your videos are amazing! Thank you!!! You break down complex things so that I can better understand what's actually going on
thanks a lot i solved the follow program only bcoz of ur help.....FIRST ONE is the one with warning and error code as following......Note: HelloWorld.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details..........SECOND ONE is correct one...
FIRST CODE WITH WARNING
import java.util.*;
public class HelloWorld {
public static void main(String[] args) {
HashMap map = new HashMap();/"line with warning"/
map.put("Father", "Rob");
map.put("Mother", "Kirsten");
System.out.println(map.toString());
}
}
SECOND CODE WITHOUT WARNING(thanks to you)
import java.util.*;
public class HelloWorld {
public static void main(String[] args) {
HashMap map = new HashMap();/"this time no warning"/
map.put("Father", "Rob");
map.put("Mother", "Kirsten");
System.out.println(map.toString());
}
}
I definitely recommend Alex's video! Easy to understand and follow!
Thank you so much, you're an awesome teacher.
that's just straight as an arrow. Awesome bro.
You do a great job! Simple and clear! Thank you.
Wow thank you I was unable to understand hash maps until I stumbled upon your video. Thank you :)
Damn, his Java tutorials are totally understandable, thanks
Best hashmap tutorial ever!
You simplified it perfectly.. thank you sir
Its called HashMap because it's a data structure that uses the hash function to generate a mapping of keys and their corresponding values.
Great video Alex, I have a quick question for you. At 3:22 you type happy.put("a", 10). Wouldn't 10 in this case be a magic number? Shouldn't that line be happy.put("a", a)?
you explained it effortless
You're the best coding tutor!
As usual GREAT! Understanding the concept in 11 minutes :)
Thanks for taking time to create content that helps me understand Java! Great job!
pls make a full session on java , your style is best .
Extremly good explained!
Way better then my proffesor! Sure its not advanced, but i at least undertood the basicis of HashMap.
Thank you.
Legend
you're a great teacher, keep going 💪
Excellent video, I understood everything. Thank you!
Helped out at lot! Very concise!
Bro why does RUclips keep recommending this. Fine! I’m here. I clicked it
It was originally used in cryptology as method of assigning a key that is generated using a underlying algorithm and thus this key is then used to place the value into a data structure that can be retrieved. From this it was used because the second and most commonly used reason now is to reduce the search time complexity from O(n), O(n^2) and so on; to O(1). The hash value is the return value of the function that used to generate that hash value and is used as the index positioning of the element and hence used as a key
You're awesome dude! Very nice and concise explanations!
Thank you for these easy-to-understand tutorials, subscribed now!!
UNDERSTANDABLE !!! Very good video ! Your explanation is clear and simple ! Good job ! I like it.
My favorite java tutor. if I am not mistaking if u want order you can use TreeMap
Hey
Love from India ❤️
Your videos are really helpful...
Thank you so much..
Plz keep upload more videos 👍
Wow ...such an amazing explanation
your voice is so comforting
What type of keyboard is that? The sound is so satisfying XD
looks like a HHKB TypeS (torpre silent 45g switches)
pag ganito proctor matuto ka talaga ;)
Alex you connect really well with your audience. Also about such subjects, I always used to think that i wont understand.. But after watching my first video, the perception has been changed. Please continue making contents. All the best to you. :)
You sound gay do you want to get on your knees for him
Thank you so much!! Finally a good explanation! Can you please make more videos on Data Structures :-)
really ur explaination was good, after watching video i got clear idea about hash map thank you.
Such a good tutorial, straightforward and useful
Gosh I wish I could watch ur vid earlier! I just love the way you teach, clear and understandable. PLZ UPLOAD MORE! LUV YA ♥
So simple explanation. Thanks!
Amazing Video!!!!!!! keep going!!! can't wait to learn more.
This Channel is underrated
I like your channel! You make it simple
Awesome video!
he makes it look and understand so easy.
Hey Alex you're amazing I really love the way you teach...Stay happy 😉
Ivbeen stressing out over this for days cuz of my final. Learned it conpletely under 12 min just now. Just need some practice and the final is gonna be ez. thanks bud!
This was really helpful. Thank you so much!
That was great! Many thanks, bro!
I must say you are really amazing and good way to explain
Beautifully explained.😄
Thank Alex, very clear explanation of HashMap.