Hash Functions | Types | Division, Mid Square and Folding Methods | Hashing | Data Structures

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 42

  • @DeeptiSonika-uz8nx
    @DeeptiSonika-uz8nx หลายเดือนก่อน +2

    Thank you sir

    • @DrAnkitVerma
      @DrAnkitVerma  หลายเดือนก่อน

      Most Welcome 🙏

  • @CSEGAYATRIPRADHAN
    @CSEGAYATRIPRADHAN ปีที่แล้ว +1

    Thank you a lot Sir .
    Your explanation is understandable for me and very helpful for me .❤

  • @KasisVerma
    @KasisVerma ปีที่แล้ว +2

    very good teaching

  • @AasthaLutare
    @AasthaLutare 13 วันที่ผ่านมา

    sir what if there is a 5 digit number in the folding method?

  • @proudtobegamer732
    @proudtobegamer732 ปีที่แล้ว +2

    amazing teaching skills!!

  • @sanjanaattanayake4231
    @sanjanaattanayake4231 ปีที่แล้ว +1

    Great explanation. Thank you Sir!

  • @anshikasharma9978
    @anshikasharma9978 2 ปีที่แล้ว +2

    Tqq a lot sir.... 💛🙏🏻😌💯
    Keep it up....💓
    U r explanations way r jst awsm n short n quick

  • @chaithanya.n3358
    @chaithanya.n3358 ปีที่แล้ว +4

    Sir I have a doubt in mid square method in vedio u have taken 2 digit key so it is possible to delete right and left digit if it is single digit key how to solve ?

    • @DeathIsTheEndOfLife
      @DeathIsTheEndOfLife ปีที่แล้ว

      Bro for single digit consider the square of key as hash value

  • @_AkeelAhmad_wani
    @_AkeelAhmad_wani 3 ปีที่แล้ว +3

    Sir in squaring method if there is 8 no. 8*8= 64
    6 =| and 4=2 2÷2=| what we have to store in 1 means we have to store 8 or 64 in one plz reply

    • @DrAnkitVerma
      @DrAnkitVerma  3 ปีที่แล้ว +14

      In Mid Square Method, first square is done then equal digits from left and right are discarded depending on set Hash function. In our example we set one digit remove from both sides and take the remaining. If 8 is number. Here 8 square will be 64. If one digit removed from both sides then nothing will remain which is wrong. So 0 will be applied before 64 which will be 064. Now discard one digit from both sides i.e. 0 & 4. Result is 6.

    • @DeathIsTheEndOfLife
      @DeathIsTheEndOfLife ปีที่แล้ว

      But sir if key is 8 and hash value is 6 then it means 8 will be store in the 6th position of the hash table but hash table size (N)is of is 3 becoz N is decided by the sum of no. Of keys and the first odd no. After the sum of no. Of keys here first odd no. After the value one is 3 therefore N is 3 and the key 8 hash value is 6 which is out of the size of the hash table

  • @HarshitKumar-bx3pt
    @HarshitKumar-bx3pt 3 ปีที่แล้ว +2

    Extremely helpful
    thank you

  • @nverkhachoyan
    @nverkhachoyan 2 ปีที่แล้ว +1

    mid-square method 6:49

  • @prasannalatha9209
    @prasannalatha9209 2 ปีที่แล้ว +2

    if 89 is also one of the key in folding method then by adding 8+9=17=7 will be the index.....then where do we store

    • @DrAnkitVerma
      @DrAnkitVerma  2 ปีที่แล้ว +3

      In folding method, first key is broken up into pieces (pieces size depends upon set hash function), then pieces are added and hash value is calculated using formula H(x) = (p1 + p2) mod m. Here p1 p2 are pieces and m is number of spaces available in hash table.
      For understanding assume hash value is like index of hash table. We are calculating hash value of key means we are calculating index where key will be stored in hash table.
      Let 89 is key and piece size is 1. Divide key 89 into 1 size pieces i.e. p1 = 8 and p2 = 9. Add pieces (p1 + p2) = 8 + 9 = 17. Let space available in hash table is 10, so m = 10 which means key can be stored in hash table from hash value (index) 0 to 9. Find hash value using formula H(x) = (p1 + p2) mod m = 17 mod 10 = 7. So key 89 will store in hash table at hash value (index) 7.

  • @keerthimoparthi9955
    @keerthimoparthi9955 ปีที่แล้ว +1

    Thank you

  • @nandansayyappan9482
    @nandansayyappan9482 10 หลายเดือนก่อน +1

    What to split the square of 2345 which is 5499025

  • @omerashfaq4472
    @omerashfaq4472 2 ปีที่แล้ว +2

    What if
    Collision occurs in both folding and mid square method?

    • @DrAnkitVerma
      @DrAnkitVerma  2 ปีที่แล้ว

      Collision Resolution Techniques are used to remove collision in Hashing.
      Refer Data Structure (DS) Playlist
      th-cam.com/play/PLU5x-SQTjZT7Byc8_BTdtMQkZ_7rjEUUm.html

  • @sourav7239
    @sourav7239 2 ปีที่แล้ว +1

    How we do this four digits no 1648 by using folding method ??

    • @DrAnkitVerma
      @DrAnkitVerma  2 ปีที่แล้ว +3

      In folding method, keys are partitioned into parts and parts are added together to find hash key.
      Here we will use formula, H(k) = (k1 + k2 + . . . + k3) mod m. Let m is 10. So for 1648, hash key will be (16 + 48) mod 10 = 64 mod 10 = 4.
      Note: There should be same formula for finding all hash keys.

  • @umakothalikar8907
    @umakothalikar8907 2 ปีที่แล้ว +1

    helped!!

  • @chaithanya.n3358
    @chaithanya.n3358 ปีที่แล้ว +1

    Wt in case collision occured in mid square and folding method

    • @DrAnkitVerma
      @DrAnkitVerma  ปีที่แล้ว

      Collision can also occur in Collision Resolution Techniques like Mid Square Method, Folding Method etc. and for that Double Hashing is used which is combination of two or more hashing techniques.

  • @ankITgamIT19
    @ankITgamIT19 2 ปีที่แล้ว +1

    thanks

  • @veronicasimone6204
    @veronicasimone6204 ปีที่แล้ว +1

    Sir can i ask again whats the basic description of hash functions? Theres no subtitles so i cant really comprehend. Thank you sir

    • @DrAnkitVerma
      @DrAnkitVerma  ปีที่แล้ว +1

      Hash Functions are used to calculate the Hash Value for the Key, so that Key can be stored in Hash Table.
      (Hash Value is like Index of Table. Keys are given Numbers which needs to be stored in Table. Hash Table is a Table which contain Hash Values and Keys.)

  • @akshaysisodia6747
    @akshaysisodia6747 ปีที่แล้ว +2

    Many points have been skipped in this video not recomennded

  • @raygplays413
    @raygplays413 ปีที่แล้ว +1

    English thik kar lo sir aur accent thoda Indian rahega to bhi chalega

    • @mr.patel0023
      @mr.patel0023 ปีที่แล้ว

      English is okay but accent should be indian