https://github.com/rishant/dsa
concept and implementation using java
https://github.com/rishant/dsa
Last synced: 18 days ago
JSON representation
concept and implementation using java
- Host: GitHub
- URL: https://github.com/rishant/dsa
- Owner: rishant
- Created: 2021-10-30T06:46:58.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-30T09:24:24.000Z (over 4 years ago)
- Last Synced: 2025-04-05T06:29:45.191Z (10 months ago)
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dsa
concept and implementation using java
# Hashing:
- It is used for fast retrival and store value.
Hashing Technics for resolve collision(टक्कर):
1. Division
2. Folding
3. Mid Squre
4. Moduler multiplication
Search Technics:
1. Linear Search - O(n)
2. Binary Search - O(log n)
Open Addressing - Chaining Method
Chaining Method:
- (If collision happens then compare exsting value and build chain example: Hashmap - Array-Of-LinkedList)
https://www.youtube.com/watch?v=zeMa9sg-VJM
Close Addressing - Linear Probling, Quarditic Probling, Double Probling Method
- Linear Probling:
- (If collision happens then find next available location and insert element)
https://www.youtube.com/watch?v=zeMa9sg-VJM
- Steps:
- 1. key = 5, m = 10; where m is maxBucketSize.
- Calculate Hash value of key hash(key) = key % m; hash(5) = 5%10;
- run loop to find available local from hash-calculated for i = 0..10 increse i++ { arr[(hash(5)+i)%m] == null -> insert(5); break;}
Quarditic Probling:
https://www.youtube.com/watch?v=dxrLtf-Fybk
- Steps:
- 1. key = 5, m = 10; where m is maxBucketSize.
- Calculate Hash value of key hash(key) = key % m; hash(5) = 5%10;
- run loop to find available local from hash-calculated for i = 0..10 increse i++ { arr[(hash(5)+(i power 2))%m] == null -> insert(5); break;}
Double Hashing:
https://www.youtube.com/watch?v=AYcsTOeFVas
- for i = 0..10 increse i++ { arr[(hash(5)+ (V*i))%m] == null -> insert(5); break;}