Dsa Unit 4
Dsa Unit 4
2) Organize Data
3) Trie
A heap is a special type of binary tree where every parent node has
either two child nodes or no child nodes, and every node satisfies one
heap property – min heap or max heap
property software programming. The Min heap property states that
every parent node must have a value less than or equal to its child
node, while the max heap property specifies that the parent node's
value must be greater than or equal to the value of its child nodes (in
the case of two children).
B-trees and T-trees are two types of trees in the data structure that are
used to efficiently store large amounts of data. These trees are often
used in databases because they allow for quick insertion and deletion of
records while still maintaining fast access times.
6) Routing Table
Inserting an element.
Removing an element.
Searching for an element.
Traversing the tree.
B+ Tree B+ tree eliminates the drawback B-tree used for indexing by storing
data pointers only at the leaf nodes of the tree. Thus, the structure of leaf
nodes of a B+ tree is quite different from the structure of internal nodes of
the B tree. It may be noted here that, since data pointers are present only at
the leaf nodes, the leaf nodes must necessarily store all the key values along
with their corresponding data pointers to the disk file block, to access them.
Moreover, the leaf nodes are linked to providing ordered access to the
records. The leaf nodes, therefore form the first level of the index, with the
internal nodes forming the other levels of a multilevel index. Some of the key
values of the leaf nodes also appear in the internal nodes, to simply act as a
medium to control the searching of a record.
Basis of
Comparison B tree B+ tree
All internal and leaf nodes have Only leaf nodes have
Pointers
data pointers data pointers
Sequential access is
Sequential access to nodes is not
Access possible just like linked
possible
list
B+ Trees used in
B-Trees used in Databases,
Application Multilevel Indexing,
Search engines
Database indexing