What is a HashSet? | Data Structures | Easy explanation with animations | Study Algorithms

  Рет қаралды 6,239

Nikhil Lohia

Nikhil Lohia

Күн бұрын

Пікірлер: 19
@raghavsyt
@raghavsyt 2 жыл бұрын
This is Gold!
@ukaszkiepas57
@ukaszkiepas57 9 ай бұрын
Thank you bro. Clean explenation :) Helped me a lot!
@fiskfisk33
@fiskfisk33 Жыл бұрын
O(1) for deleting an element in an array is debatable, if you want to move the above elements down to fill the gap it gets slower.
@DailyFacts-vu4cv
@DailyFacts-vu4cv Ай бұрын
thanks bro
@amruthaj4262
@amruthaj4262 9 ай бұрын
I just wanna know, is the time complexity O(1) for a Linked List at the head and tail?
@nikoo28
@nikoo28 8 ай бұрын
to add an element at the tail of the linked list, the time complexity is O(n). to add at the head, the time complexity is O(1)
@amruthaj4262
@amruthaj4262 8 ай бұрын
@@nikoo28Thank you
@puriatc1089
@puriatc1089 6 ай бұрын
ok but , how it uses hashing to do all this operations in O(1) time complexity? thats what i wanted to know :(
@nikoo28
@nikoo28 5 ай бұрын
Those are the internal details on how a hashset actually works. I will create a separate video on hashing sometime in the future.
@anmolverma075
@anmolverma075 2 жыл бұрын
Sir , where can I contact you? I need some help.
@nikoo28
@nikoo28 2 жыл бұрын
Check the channel description, you will find an email address to reach out. You can also comment here
@anmolverma075
@anmolverma075 2 жыл бұрын
I cannot sir. Can we talk on LinkedIn or Discord/Twitter?
@nikoo28
@nikoo28 2 жыл бұрын
Send me an email
@ap-learner
@ap-learner 3 ай бұрын
You said it O(1) for reading but not explained why it is, Please explain
@nikoo28
@nikoo28 3 ай бұрын
you will have to understand the internals of a HashSet data structure. I plan to make a video on it in my System Design series
@ET-Programming
@ET-Programming Жыл бұрын
deleting an element from an Array is o(1) only for if the element is the last element on the array ,so if i want to remove an element from middle it is o(n) ,
@nikoo28
@nikoo28 Жыл бұрын
in an array, you can go straight to an index. That means O(1)
@saiprasad5779
@saiprasad5779 2 жыл бұрын
How it different from dictionary
@nikoo28
@nikoo28 2 жыл бұрын
It is almost the same as a dictionary…the major difference is that a hashset is synchronised (works good in a multi threading code) The use of Dictionary is now kind of obsolete and deprecated. You are not advised to use a Dictionary
Set and HashSet in Java - Full Tutorial
20:43
Coding with John
Рет қаралды 233 М.
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 17 МЛН
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН
Python Hash Sets Explained & Demonstrated - Computerphile
18:39
Computerphile
Рет қаралды 122 М.
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 853 М.
Hash Tables and Hash Functions
13:56
Computer Science Lessons
Рет қаралды 1,6 МЛН
C# Hashsets - Understand them, use them, LOVE them
10:28
tutorialsEU - C#
Рет қаралды 15 М.
What is a HashSet?
23:41
Earthcomputer
Рет қаралды 17 М.