{"id":11888,"date":"2023-01-19T12:08:21","date_gmt":"2023-01-19T12:08:21","guid":{"rendered":"https:\/\/www.prepbytes.com\/blog\/?p=11888"},"modified":"2023-02-02T08:17:23","modified_gmt":"2023-02-02T08:17:23","slug":"hashing-in-data-structure","status":"publish","type":"post","link":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/","title":{"rendered":"Hashing in Data Structure"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg\" alt=\"\" \/><\/p>\n<p>In this article, we will learn what is hashing in data structure, index mapping in hashing, what is a collision in a hash table in data structure, separate chaining collision handling technique in hashing, and open addressing collision handling technique in hashing.<\/p>\n<h2>What is Hashing in Data Structure?<\/h2>\n<p>It is a method for storing and retrieving data from a database in O(1) time. Sometimes it is called mapping. With the help of hashing in data structure, we convert larger values into smaller values using the concept of hashing.<br \/>\nWith the help of the search key, we point the data into the database and for this, we use a pointer in hashing.<\/p>\n<p>There are three main terms in hashing.<\/p>\n<p><strong> 1. Search Key<\/strong><br \/>\nIt is a unique number that we will put into a hash table to retrieve or store data from a database.<br \/>\nFor example, We find out a particular student in a classroom with the help of the student roll number.<\/p>\n<p><strong>2. Hash Table in data structure<\/strong><br \/>\nIt is a data structure that provides a methodology to store data in a proper way. It looks like an array but in actuality, it is not an array.<\/p>\n<p><strong>3. Hash Function<\/strong><br \/>\nUsing the hash function, we insert, delete and search data in a hash table in O(1) time. <\/p>\n<p>There are mainly one hash function methods.<\/p>\n<ul>\n<li><strong>K mod N ( Where N is the number of keys)<\/strong><br \/>\nIn this function, we divide the search key by N and get a reminder. The reminder is a hash value. A hash value is the index number of the hash table and we will put the search key on that index number in a hash table.<\/li>\n<\/ul>\n<h2>Index Mapping in Hashing<\/h2>\n<p>We will understand the above terminology with the help of the example and we will also learn index mapping in a hash table in the data structure.<\/p>\n<p>Here, we use the hash function ( k mod 10) to put the search key in a hash table. That is why in a hash table we have a 0-9 index number.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<p>Search key ( 45, 56. 17, 23, 32, 81)<br \/>\nHash function ( k mod 10)<\/p>\n<p>For key: 45<br \/>\nHash Value: 45 mod 10 = 5<br \/>\nSo we will map 45 at index number 5 of a hash table.<\/p>\n<p>For key: 56<br \/>\nHash Value: 56 mod 10 = 6<br \/>\nSo we will map 56 at index number 6 of a hash table.<\/p>\n<p>Likewise, We will calculate the hash value for left keys and put the key in a hash table according to its hash value.<\/p>\n<p>After inserting a key in a hash table in data structure, hash table looks like:<\/p>\n<table>\n<thead>\n<tr>\n<th>Search Key<\/th>\n<th>Index<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>81<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>32<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>23<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>45<\/td>\n<td>5<\/td>\n<\/tr>\n<tr>\n<td>56<\/td>\n<td>6<\/td>\n<\/tr>\n<tr>\n<td>17<\/td>\n<td>7<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>8<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Code Implementation<\/strong><br \/>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_11892 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_11892 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_11892 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_11892 .wpsm_nav-tabs > li.active > a, #tab_container_11892 .wpsm_nav-tabs > li.active > a:hover, #tab_container_11892 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_11892 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_11892 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_11892 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_11892 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_11892 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_11892 .wpsm_nav-tabs > li > a:hover , #tab_container_11892 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_11892 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_11892 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_11892 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_11892 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_11892 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_11892 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_11892 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11892 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_11892 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_11892 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_11892 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_11892\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_11892\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_11892_1\" aria-controls=\"tabs_desc_11892_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>C<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_11892\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_11892_1\">\r\n\t\t\t\t\t\t\t\t<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ What is hashing in data structure\r\n\/\/ hasing program in c\r\n\r\n#include <stdio.h>\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#include <stdbool.h>\r\n\r\n#define SIZE 20\r\n\r\nstruct DataItem {\r\n   int data;   \r\n   int key;\r\n};\r\n\r\nstruct DataItem* hashArray[SIZE]; \r\nstruct DataItem* dummyItem;\r\nstruct DataItem* item;\r\n\r\nint hashCode(int key) {\r\n   return key % SIZE;\r\n}\r\n\r\nstruct DataItem *find(int key) {\r\n    \r\n   int hashIndex = hashCode(key);  \r\n    \r\n    \r\n   while(hashArray[hashIndex] != NULL) {\r\n    \r\n      if(hashArray[hashIndex]->key == key)\r\n         return hashArray[hashIndex]; \r\n            \r\n         ++hashIndex;\r\n        \r\n      \r\n      hashIndex %= SIZE;\r\n   }        \r\n    \r\n   return NULL;        \r\n}\r\n\r\nvoid insert(int key,int data) {\r\n\r\n   struct DataItem *item = (struct DataItem*) malloc(sizeof(struct DataItem));\r\n   item->data = data;  \r\n   item->key = key;\r\n\r\n  \r\n   int hashIndex = hashCode(key);\r\n\r\n   \r\n   while(hashArray[hashIndex] != NULL && hashArray[hashIndex]->key != -1) {\r\n      \r\n      ++hashIndex;\r\n        \r\n      \r\n      hashIndex %= SIZE;\r\n   }\r\n    \r\n   hashArray[hashIndex] = item;\r\n}\r\n\r\nstruct DataItem* delete(struct DataItem* item) {\r\n   int key = item->key;\r\n\r\n   \r\n   int hashIndex = hashCode(key);\r\n\r\n   \r\n   while(hashArray[hashIndex] != NULL) {\r\n    \r\n      if(hashArray[hashIndex]->key == key) {\r\n         struct DataItem* temp = hashArray[hashIndex]; \r\n            \r\n         \r\n         hashArray[hashIndex] = dummyItem; \r\n         return temp;\r\n      }\r\n        \r\n      \r\n      ++hashIndex;\r\n        \r\n      \r\n      hashIndex %= SIZE;\r\n   }      \r\n    \r\n   return NULL;        \r\n}\r\n\r\nvoid display() {\r\n   int i = 0;\r\n    \r\n   for(i = 0; i<SIZE; i++) {\r\n    \r\n      if(hashArray[i] != NULL)\r\n         printf(\" (%d,%d)\",hashArray[i]->key,hashArray[i]->data);\r\n      else\r\n         printf(\" ----- \");\r\n   }\r\n    \r\n   printf(\"&#92;n\");\r\n}\r\n\r\nint main() {\r\n   dummyItem = (struct DataItem*) malloc(sizeof(struct DataItem));\r\n   dummyItem->data = -1;  \r\n   dummyItem->key = -1; \r\n\r\n   insert(2, 90);\r\n   insert(3, 750);\r\n   insert(4, 20);\r\n   insert(6, 27);\r\n   insert(32, 47);\r\n   insert(14, 39);\r\n   insert(77, 14);\r\n   insert(33, 79);\r\n   insert(37, 91);\r\n\r\n   display();\r\n   item = find(14);\r\n\r\n   if(item != NULL) {\r\n      printf(\"Element found: %d&#92;n\", item->data);\r\n   } else {\r\n      printf(\"Element not found&#92;n\");\r\n   }\r\n\r\n   delete(item);\r\n   item = find(14);\r\n\r\n   if(item != NULL) {\r\n      printf(\"Element found: %d&#92;n\", item->data);\r\n   } else {\r\n      printf(\"Element not found&#92;n\");\r\n   }\r\n}<\/pre>\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_11892 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_11892 a\"),jQuery(\"#tab-content_11892\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t<\/p>\n<p><strong>Output<\/strong><\/p>\n<pre><code>-----  -----  (2,90) (3,750) (4,20) -----  (6,27) -----  -----  -----  -----  -----  (32,47) (33,79) (14,39) -----  -----  (77,14) (37,91) ----- \n\nElement found: 39\nElement not found<\/code><\/pre>\n<h2>What is Collision?<\/h2>\n<p>In a hash table, there is a chance that two keys result in the same value. A collision occurs when a newly inserted key maps to an already occupied slot in the hash table and must be solved using some collision handling technique.<\/p>\n<p>There are mainly two collision handling techniques.<\/p>\n<ol>\n<li>Separate Chaining<\/li>\n<li>Open Addressing<\/li>\n<\/ol>\n<h2>Separate Chaining Collision Handling Technique in Hashing<\/h2>\n<p>In this technique, we will build an array as a linked list called a chain. Because of that, When multiple elements are mapped into the same slot index, they are inserted into a chain, which is a singly-linked list.<br \/>\nAll elements that hash into the same slot index are inserted into a linked list in this case. We now use a key K to search the linked list by simply traversing it linearly. If the intrinsic key for any entry is equal to K, we have found our entry. If we have reached the end of the linked list and still have not found our entry, it&#8217;s because it doesn&#8217;t exist. As a result, in separate chaining, if two different elements have the same hash value, we store both of them in the same linked list one after the other.<\/p>\n<p>Now, we will understand the separate chaining technique using examples.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<p>Search key: 24, 19, 32, 44, 56<br \/>\nHash function:( K mod 6)<\/p>\n<p><strong>Step 1:<\/strong><br \/>\nWe will calculate the hash value of 24.<br \/>\nHash value of 24 = 24 mod 6 = 0.<br \/>\nSo, we will insert 24 at index number 0 in a hash table.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605894-Hashing%20in%20Data%20Structure2.png\" alt=\"\" \/><\/p>\n<p><strong>Step 2:<\/strong><br \/>\nWe will calculate the hash value of 19 and 32.<br \/>\nHash value of 19 = 19 mod 6 = 1.<br \/>\nHash value of 32 = 32 mod 6 = 2.<br \/>\nSo, we will insert 19 and 32 at index numbers 1 and 2 respectively in a hash table.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605894-Hashing%20in%20Data%20Structure3.png\" alt=\"\" \/><\/p>\n<p><strong>Step 3:<\/strong><br \/>\nWe will calculate the hash value of 44.<br \/>\nHash value of 44 = 44 mod 6 = 2.<br \/>\nNow, we insert the 44 at index number 2 which is preoccupied with 32. Here, Collision occurs which is why we have to add a chain at 32.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605894-Hashing%20in%20Data%20Structure4.png\" alt=\"\" \/><\/p>\n<p><strong>Step 4:<\/strong><br \/>\nWe will calculate the hash value of 56.<br \/>\nHash value of 56 = 56 mod 6 = 2.<br \/>\nNow, we insert the 56 at index number 2 which is preoccupied with 32. Here, again Collision occurs which is why we have to add a chain at 44.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605901-Hashing%20in%20Data%20Structure5.png\" alt=\"\" \/><\/p>\n<h2>Open Addressing Collision Handling Technique in Hashing<\/h2>\n<p>All elements in Open Addressing are stored in the hash table itself. As a result, at any point, the table&#8217;s size must be greater than or equal to the total number of keys.<\/p>\n<p>There are mainly three ways of open addressing.<\/p>\n<h3>1. Linear Probing<\/h3>\n<p>In this technique, When we insert the key at index number, at that time if slot is occupied then we will find next empty slot in hash table to put that key.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<p>Search Keys: 43, 135, 72, 23, 99, 19, 82<br \/>\nHash Function: K mod 10<\/p>\n<p><strong>Step 1:<\/strong> First, create an empty hash table with a possible range of hash values ranging from 0 to 9 based on the hash function provided.<\/p>\n<p><strong>Step 2:<\/strong> We will find hash value one by one and according to its hash value, we will insert the key in a hash table. In this step, we wil calculate hash value of first three key.<\/p>\n<p>Hash value (43) = 43 mod 10 = 3<br \/>\nHash value (135) = 135 mod 10 = 5<br \/>\nHash value (72) = 72 mod 10 = 2<\/p>\n<p>Now, we will insert 43, 135 and 72 at index numbers 3,5 and 2 respectively.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605902-Hashing%20in%20Data%20Structure6.png\" alt=\"\" \/><\/p>\n<p><strong>Step 3:<\/strong> Calculate hash value for key 23.<br \/>\nHash value (23) = 23 mod 10 = 3<\/p>\n<p>Now, we will insert 23 at index number 3 but index number 3 is preoccupied with 43. So, we will find next empty slot for mapping.<br \/>\nWe find out that next empty slot is index number 4. So we will insert 43 at index number 4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605902-Hashing%20in%20Data%20Structure7.png\" alt=\"\" \/><\/p>\n<p><strong>Step 4:<\/strong> Calculate hash value for key 99.<br \/>\nHash value (99) = 99 mod 10 = 9<\/p>\n<p>Now, we will insert 99 at index number 9 in a hash table.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605908-Hashing%20in%20Data%20Structure8.png\" alt=\"\" \/><\/p>\n<p><strong>Step 5:<\/strong> Calculate hash value for key 19.<br \/>\nHash value (19) = 19 mod 10 = 9<\/p>\n<p>Now, we will insert 19 at index number 9 but index number 9 is preoccupied with 99. So, we will find next empty slot for mapping.<br \/>\nWe find out that next empty slot is index number 0. So we will insert 19 at index number 0.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605908-Hashing%20in%20Data%20Structure9.png\" alt=\"\" \/><\/p>\n<p><strong>Step 6:<\/strong> Calculate hash value for key 82.<br \/>\nHash value (82) = 82 mod 10 = 2<\/p>\n<p>Now, we will insert 82 at index number 2 but index number 2 is preoccupied with 72. So, we will find next empty slot for mapping.<br \/>\nWe find out that next empty slot is index number 6. So we will insert 82 at index number 6.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605922-Hashing%20in%20Data%20Structure10.png\" alt=\"\" \/><\/p>\n<h3>Quadratic Probing<\/h3>\n<p>In this technique, When we insert the key at index number, at that time if slot is occupied then we will find empty slot in hash table to put that key using hash function<br \/>\n<strong>(h(k) + i^2) mod N  ;<\/strong> where h(k) is hash value and<br \/>\n(i) is number of time attempting to find slot..<\/p>\n<p><strong>Example:<\/strong><\/p>\n<p>Search Keys: 42, 16, 91, 33, 18, 27, 36, 62<br \/>\nHash Function: K mod 10<\/p>\n<p><strong>Step 1:<\/strong> First, create an empty hash table with a possible range of hash values ranging from 0 to 9 based on the hash function provided.<\/p>\n<p><strong>Step 2:<\/strong> We will find hash value one by one and according to its hash value, we will insert the key in a hash table. In this step, we wil calculate hash value of first six key.<\/p>\n<p>Hash value (42) = 42 mod 10 = 2<br \/>\nHash value (16) = 16 mod 10 = 6<br \/>\nHash value (91) = 91 mod 10 = 1<br \/>\nHash value (33) = 33 mod 10 = 3<br \/>\nHash value (18) = 18 mod 10 = 8<br \/>\nHash value (27) = 27 mod 10 = 7<\/p>\n<p>Now, we will insert 42, 16 and 91 at index numbers 2,6 and 1 respectively and also insert 33, 18 and 27 at index numbers 3, 8 and 7.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605922-Hashing%20in%20Data%20Structure11.png\" alt=\"\" \/><\/p>\n<p><strong>Step 3:<\/strong> Calculate hash value for key 36.<br \/>\nHash value (36) = 36 mod 10 = 6<\/p>\n<p>Now, we will insert 36 at index number 6 but index number 6 is preoccupied with 16. So, we will find empty slot for mapping using hash function <strong>(h(k) + i^2) mod 10<\/strong>.<\/p>\n<p><strong>(h(k) + i^2) mod 10<\/strong><br \/>\n(6 + (1)^2) mod 10<br \/>\n(7) mod 10<br \/>\n7<br \/>\nHere, index number 7 is also preoccupied with 27. So we will find next empty slot.<\/p>\n<p><strong>(h(k) + i^2) mod 10<\/strong><br \/>\n(6 + (2)^2) mod 10<br \/>\n(10) mod 10<br \/>\n0<\/p>\n<p>We find out that empty slot is index number 0. So we will insert 36  at index number 0.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605922-Hashing%20in%20Data%20Structure12.png\" alt=\"\" \/><\/p>\n<p><strong>Step 4:<\/strong> Calculate hash value for key 62.<br \/>\nHash value (62) = 62 mod 10 = 2<\/p>\n<p>Now, we will insert 62 at index number 2 but index number 2 is preoccupied with 42. So, we will find empty slot for mapping using hash function <strong>(h(k) + i^2) mod 10<\/strong>.<\/p>\n<p><strong>(h(k) + i^2) mod 10<\/strong><br \/>\n(2 + (1)^2) mod 10<br \/>\n(3) mod 10<br \/>\n3<br \/>\nHere, index number 3 is also preoccupied with 33. So we will find next empty slot.<\/p>\n<p><strong>(h(k) + i^2) mod 10<\/strong><br \/>\n(2 + (2)^2) mod 1<br \/>\n(6) mod 10<br \/>\n6<br \/>\nHere, index number 6 is also preoccupied with 16.<\/p>\n<p>(h(k) + i^2) mod 10<br \/>\n(2 + (3)^2) mod 10<br \/>\n(11) mod 10<br \/>\n1<br \/>\nHere, index number 1 is also preoccupied with 91.<\/p>\n<p><strong>(h(k) + i^2) mod 10<\/strong><br \/>\n(2 + (4)^2) mod 10<br \/>\n(18) mod 10<br \/>\n8<br \/>\nHere, index number 8 is also preoccupied with 18.<\/p>\n<p>We tried to find empty slot but it did not happen because function is in iterative mode. We will never find empty slot for this value using function.<\/p>\n<p>This is the major disadvantage of quadratic probing technique.<\/p>\n<h3>Double Hashing<\/h3>\n<p>In this technique, When we insert the key at index number, at that    time if slot is occupied then we will find empty slot in hash table to put that key using second hash function<br \/>\n<strong>(h1(k) + (i)h2(k)) mod N<\/strong><\/p>\n<p>Another hash function is used to compute the intervals between probes. Double hashing is a technique for optimising clustering reduction.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<p>Search key: 20, 34, 45<br \/>\nh1(k): k mod 11<br \/>\nh2(k): 8 &#8211; (k mod 8)<\/p>\n<p><strong>Step 1:<\/strong> First, create an empty hash table with a possible range of hash values ranging from 0 to 11 based on the hash function provided.<\/p>\n<p><strong>Step 2:<\/strong> We will find hash value one by one and according to its hash value, we will insert the key in a hash table. In this step, we wil calculate hash value of first two key.<\/p>\n<p>Hash value (20) = 20 mod 11 = 9<br \/>\nHash value (34) = 34 mod 11 = 1<\/p>\n<p>Now, we will insert 20 and 34 at index numbers 9 and 1 respectively.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605931-Hashing%20in%20Data%20Structure13.png\" alt=\"\" \/><\/p>\n<p><strong>Step 3:<\/strong> Calculate hash value for key 45.<br \/>\nHash value (45) = 45 mod 11 = 1<\/p>\n<p>Now, we will insert 45 at index number 1 but index number 1 is preoccupied with 34. So, we will find next empty slot for mapping using function.<\/p>\n<p><strong>(h1(k) + (i)h2(k)) mod N<\/strong><br \/>\n(1 + (1) (8 &#8211; (45 mod 8))) mod 11<br \/>\n(1 + (1) (8 &#8211; 5)) mod 11<br \/>\n(1 + (1)(3)) mod 11<br \/>\n(4) mod 11<br \/>\n4<\/p>\n<p>We find out that empty slot is index number 4. So we will insert 45 at index number 4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605931-Hashing%20in%20Data%20Structure14.png\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will learn what is hashing in data structure, index mapping in hashing, what is a collision in a hash table in data structure, separate chaining collision handling technique in hashing, and open addressing collision handling technique in hashing. What is Hashing in Data Structure? It is a method for storing and [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[191],"tags":[],"class_list":["post-11888","post","type-post","status-publish","format-standard","hentry","category-data-structure"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Hashing in Data Structure<\/title>\n<meta name=\"description\" content=\"Here we will learn what is hashing in data structure, index mapping in hashing,collision in a hash table, collision handling techniques in hashing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hashing in Data Structure\" \/>\n<meta property=\"og:description\" content=\"Here we will learn what is hashing in data structure, index mapping in hashing,collision in a hash table, collision handling techniques in hashing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/\" \/>\n<meta property=\"og:site_name\" content=\"PrepBytes Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prepbytes0211\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-19T12:08:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-02T08:17:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg\" \/>\n<meta name=\"author\" content=\"Prepbytes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prepbytes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/\"},\"author\":{\"name\":\"Prepbytes\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\"},\"headline\":\"Hashing in Data Structure\",\"datePublished\":\"2023-01-19T12:08:21+00:00\",\"dateModified\":\"2023-02-02T08:17:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/\"},\"wordCount\":1694,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg\",\"articleSection\":[\"Data Structure\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/\",\"url\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/\",\"name\":\"Hashing in Data Structure\",\"isPartOf\":{\"@id\":\"http:\/\/43.205.93.38\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg\",\"datePublished\":\"2023-01-19T12:08:21+00:00\",\"dateModified\":\"2023-02-02T08:17:23+00:00\",\"description\":\"Here we will learn what is hashing in data structure, index mapping in hashing,collision in a hash table, collision handling techniques in hashing.\",\"breadcrumb\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#primaryimage\",\"url\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg\",\"contentUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/43.205.93.38\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data Structure\",\"item\":\"https:\/\/prepbytes.com\/blog\/category\/data-structure\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Hashing in Data Structure\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/43.205.93.38\/#website\",\"url\":\"http:\/\/43.205.93.38\/\",\"name\":\"PrepBytes Blog\",\"description\":\"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING\",\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/43.205.93.38\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/43.205.93.38\/#organization\",\"name\":\"Prepbytes\",\"url\":\"http:\/\/43.205.93.38\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"contentUrl\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"width\":160,\"height\":160,\"caption\":\"Prepbytes\"},\"image\":{\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/prepbytes0211\/\",\"https:\/\/www.instagram.com\/prepbytes\/\",\"https:\/\/www.linkedin.com\/company\/prepbytes\/\",\"https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\",\"name\":\"Prepbytes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"caption\":\"Prepbytes\"},\"url\":\"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hashing in Data Structure","description":"Here we will learn what is hashing in data structure, index mapping in hashing,collision in a hash table, collision handling techniques in hashing.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/","og_locale":"en_US","og_type":"article","og_title":"Hashing in Data Structure","og_description":"Here we will learn what is hashing in data structure, index mapping in hashing,collision in a hash table, collision handling techniques in hashing.","og_url":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/","og_site_name":"PrepBytes Blog","article_publisher":"https:\/\/www.facebook.com\/prepbytes0211\/","article_published_time":"2023-01-19T12:08:21+00:00","article_modified_time":"2023-02-02T08:17:23+00:00","og_image":[{"url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg","type":"","width":"","height":""}],"author":"Prepbytes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prepbytes","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#article","isPartOf":{"@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/"},"author":{"name":"Prepbytes","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e"},"headline":"Hashing in Data Structure","datePublished":"2023-01-19T12:08:21+00:00","dateModified":"2023-02-02T08:17:23+00:00","mainEntityOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/"},"wordCount":1694,"commentCount":0,"publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg","articleSection":["Data Structure"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/","url":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/","name":"Hashing in Data Structure","isPartOf":{"@id":"http:\/\/43.205.93.38\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#primaryimage"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg","datePublished":"2023-01-19T12:08:21+00:00","dateModified":"2023-02-02T08:17:23+00:00","description":"Here we will learn what is hashing in data structure, index mapping in hashing,collision in a hash table, collision handling techniques in hashing.","breadcrumb":{"@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#primaryimage","url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg","contentUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1674128605730-Hashing%20in%20Data%20Structure.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/prepbytes.com\/blog\/hashing-in-data-structure\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/43.205.93.38\/"},{"@type":"ListItem","position":2,"name":"Data Structure","item":"https:\/\/prepbytes.com\/blog\/category\/data-structure\/"},{"@type":"ListItem","position":3,"name":"Hashing in Data Structure"}]},{"@type":"WebSite","@id":"http:\/\/43.205.93.38\/#website","url":"http:\/\/43.205.93.38\/","name":"PrepBytes Blog","description":"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING","publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/43.205.93.38\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/43.205.93.38\/#organization","name":"Prepbytes","url":"http:\/\/43.205.93.38\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/","url":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","contentUrl":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","width":160,"height":160,"caption":"Prepbytes"},"image":{"@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/prepbytes0211\/","https:\/\/www.instagram.com\/prepbytes\/","https:\/\/www.linkedin.com\/company\/prepbytes\/","https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA"]},{"@type":"Person","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e","name":"Prepbytes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","caption":"Prepbytes"},"url":"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/"}]}},"_links":{"self":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/11888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/comments?post=11888"}],"version-history":[{"count":2,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/11888\/revisions"}],"predecessor-version":[{"id":11898,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/11888\/revisions\/11898"}],"wp:attachment":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/media?parent=11888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/categories?post=11888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/tags?post=11888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}