Posts

Showing posts with the label DBMS

B+ Tree in DBMS | B+ Tree in Data Structure

    B+  Tree A B+ Tree is a self-balancing multi-way search tree   All leaf nodes are present at the same level . Actual data records are stored only in the leaf nodes . Internal nodes contain only search keys . It is mainly used for efficient searching and sequential access . B+ Tree supports efficient range queries . Structure of B+ Tree Consider a B+ Tree node containing keys and children: Number of Keys Number of Children 1 2 2 3 3 4 In general, Number of children = Number of keys + 1 The leaf nodes are connected sequentially using links( Linked List ). Rules of B+ Tree For a B+ Tree of order m : At most: A node can have at most m children . A node can contain at most m − 1 keys. At least: An internal node must have at least [ m/2 ] children . An internal node must contain at least [ m/2 ] − 1 keys . Insertion...

Hashing in Data Structure | Collision Resolution Techniques | Hashing in DBMS

  Hashing in DBMS Hashing is a technique used to map data elements (keys) to specific locations in a hash table using a hash function. It allows insertion and retrieval of data efficiently     Hash Function A hash function converts a key into a hash code (index) , which is used to store and retrieve the data from a hash table.                                 h(k)=k mod m Where: k → Key m → Hash table size h(k) → Hash index  Hash Table A hash table is a data structure that stores data in an array format . Each position in the table is called a bucket , and the position is accessed using the hash function. Example Consider Keys                   (k) = 11, 18, 20, 25, 29, 33 Hash table size (m) = 7 Hash function:    h(k)=k mod m                     ...