title
5.27 Insertion in B-Tree of Order 4 (Data Structure)
description
Learn how to Insert Data in B-Tree of Order 4 in Data Structures and Algorithms
DSA Full Course: https: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bbKJzrsKfMpo_grxuLl8LU
******************************************
More Playlists:
C Programming Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31a8UcMN9-35ghv8qyFWD9_S
C++ Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YU5Wx1dopka58teWP9aCee
Python Full Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bZSiqiOL5ta39vSnBxpOPT
Printing Pattern in C: https://www.youtube.com/playlist?list=PLdo5W4Nhv31Yu1igxTE2x0aeShbKtVcCy
DAA Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31ZTn2P9vF02bkb3SC8uiUUn
Placement Series: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YvlDpJhvOYbM9Ap8UypgEy
Dynamic Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31aBrJE1WS4MR9LRfbmZrAQu
Operating Systems: //www.youtube.com/playlist?list=PLdo5W4Nhv31a5ucW_S1K3-x6ztBRD-PNa
DBMS: https://www.youtube.com/playlist?list=PLdo5W4Nhv31b33kF46f9aFjoJPOkdlsRc
******************************************
Connect & Contact Me:
Facebook: https://www.facebook.com/Jennys-Lectures-CSIT-Netjrf-316814368950701/
Quora: https://www.quora.com/profile/Jayanti-Khatri-Lamba
Instagram: https://www.instagram.com/jayantikhatrilamba/
detail
{'title': '5.27 Insertion in B-Tree of Order 4 (Data Structure)', 'heatmap': [{'end': 253.317, 'start': 229.597, 'weight': 0.729}, {'end': 304.81, 'start': 282.909, 'weight': 0.857}, {'end': 555.915, 'start': 470.417, 'weight': 0.793}, {'end': 641.649, 'start': 626.078, 'weight': 0.721}, {'end': 805.243, 'start': 776.276, 'weight': 0.776}], 'summary': 'Covers constructing a b tree of order 4 with a given set of data, explaining the insertion and splitting process, proper positioning, and maximum key limit of 3 per node. it demonstrates the insertion of key values and the subsequent splitting and rearranging of nodes to maintain the b-tree structure.', 'chapters': [{'end': 310.551, 'segs': [{'end': 64.84, 'src': 'embed', 'start': 29.845, 'weight': 0, 'content': [{'end': 37.468, 'text': 'the maximum keys any node can have is m minus one.', 'start': 29.845, 'duration': 7.623}, {'end': 41.55, 'text': 'that is four minus one and that is three.', 'start': 37.468, 'duration': 4.082}, {'end': 45.292, 'text': 'okay, now, see, first of all, scan this.', 'start': 41.55, 'duration': 3.742}, {'end': 46.492, 'text': 'you know this.', 'start': 45.292, 'duration': 1.2}, {'end': 50.414, 'text': 'given a set of data from left to right, first number is five.', 'start': 46.492, 'duration': 3.922}, {'end': 52.555, 'text': 'we will insert this five into b tree.', 'start': 50.414, 'duration': 2.141}, {'end': 55.296, 'text': 'but initially we have, you know, empty b tree.', 'start': 52.555, 'duration': 2.741}, {'end': 64.84, 'text': 'so one node will be created, One node will be created and that node can have maximum keys three.', 'start': 55.296, 'duration': 9.544}], 'summary': 'B tree can have maximum 3 keys, and initially an empty b tree will have 1 node.', 'duration': 34.995, 'max_score': 29.845, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu829845.jpg'}, {'end': 258.958, 'src': 'heatmap', 'start': 229.597, 'weight': 0.729, 'content': [{'end': 234.323, 'text': 'Sorry, either you can take 5 as a middle element or 9 as a middle element.', 'start': 229.597, 'duration': 4.726}, {'end': 238.968, 'text': 'If you take 5 as a middle element, then the tree you will create.', 'start': 234.883, 'duration': 4.085}, {'end': 240.57, 'text': 'what will happen?', 'start': 238.968, 'duration': 1.602}, {'end': 247.816, 'text': '5 will go up and the left child of 5 is 3, the right child of 5 is 9 and 21..', 'start': 240.57, 'duration': 7.246}, {'end': 253.317, 'text': 'Okay If you would take nine as middle element, then what will happen? Nine would go one level up.', 'start': 247.816, 'duration': 5.501}, {'end': 258.958, 'text': 'And the left child of nine would be three, five and right would be 21.', 'start': 254.497, 'duration': 4.461}], 'summary': 'Decision between 5 and 9 as middle element, creating trees with specific child nodes.', 'duration': 29.361, 'max_score': 229.597, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8229597.jpg'}, {'end': 310.551, 'src': 'heatmap', 'start': 282.909, 'weight': 2, 'content': [{'end': 291.112, 'text': 'you can take any middle element from this when you know the order is.', 'start': 282.909, 'duration': 8.203}, {'end': 294.413, 'text': 'even in that case it will happen.', 'start': 291.112, 'duration': 3.301}, {'end': 302.729, 'text': 'so see, let us take 5 as middle element.', 'start': 294.413, 'duration': 8.316}, {'end': 304.81, 'text': 'Okay The tree would be left biased.', 'start': 303.11, 'duration': 1.7}, {'end': 310.551, 'text': 'How many 5 as middle element considered? Then the tree would be 5 would go one level up.', 'start': 304.85, 'duration': 5.701}], 'summary': 'Consider 5 as the middle element to obtain a left-biased tree.', 'duration': 35.225, 'max_score': 282.909, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8282909.jpg'}], 'start': 0.765, 'title': 'Constructing b tree of order 4', 'summary': 'Discusses the process of constructing a b tree of order 4 with a given set of data, explaining the insertion and splitting process along with determining the middle element and its impact on creating left and right biased trees.', 'chapters': [{'end': 310.551, 'start': 0.765, 'title': 'Constructing b tree of order 4', 'summary': 'Discusses the process of constructing a b tree of order 4 with a given set of data, explaining the insertion and splitting process along with determining the middle element and its impact on creating left and right biased trees.', 'duration': 309.786, 'highlights': ['The maximum keys any node can have in a B tree of order 4 is 3, and the process of inserting and splitting nodes is explained, providing a clear understanding of the structure and organization of the tree.', 'The process of inserting numbers into the B tree is detailed, including the comparison and placement of numbers in the nodes, with a focus on maintaining ascending order and managing node capacity.', 'The concept of finding the middle element in a node and its impact on creating left and right biased trees is thoroughly explained, offering insights into the decision-making process during the tree construction.']}], 'duration': 309.786, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8765.jpg', 'highlights': ['The maximum keys any node can have in a B tree of order 4 is 3, providing a clear understanding of the structure and organization of the tree.', 'The process of inserting numbers into the B tree is detailed, focusing on maintaining ascending order and managing node capacity.', 'The concept of finding the middle element in a node and its impact on creating left and right biased trees is thoroughly explained, offering insights into the decision-making process during the tree construction.']}, {'end': 486.744, 'segs': [{'end': 380.835, 'src': 'embed', 'start': 312.451, 'weight': 0, 'content': [{'end': 317.192, 'text': 'Left child of, you can say left subtree of this 5 would be only 3.', 'start': 312.451, 'duration': 4.741}, {'end': 324.914, 'text': 'Okay And the right would be 9 and 21.', 'start': 317.192, 'duration': 7.722}, {'end': 336.639, 'text': 'Fine, okay, sorry, the next number is 1.', 'start': 324.914, 'duration': 11.725}, {'end': 340.643, 'text': 'we have inserted 9 and the next is 1.', 'start': 336.639, 'duration': 4.004}, {'end': 346.709, 'text': 'now you have to find out the proper position to insert this 1 in this b-tree.', 'start': 340.643, 'duration': 6.066}, {'end': 353.676, 'text': 'and one rule is that any new number will always be inserted in leaf node.', 'start': 346.709, 'duration': 6.967}, {'end': 359.524, 'text': 'you cannot insert into root node one, but firstly we will compare this one always.', 'start': 353.676, 'duration': 5.848}, {'end': 363.326, 'text': 'what will be compare when we insert from the root node?', 'start': 359.524, 'duration': 3.802}, {'end': 368.448, 'text': 'compare will start from root node but insert will be always in leaf node.', 'start': 363.326, 'duration': 5.122}, {'end': 371.509, 'text': 'so one would be compared with this five.', 'start': 368.448, 'duration': 3.061}, {'end': 376.892, 'text': 'we know one is less than five, so we will go to the left part of five.', 'start': 371.509, 'duration': 5.383}, {'end': 378.973, 'text': 'now we have three in this node.', 'start': 376.892, 'duration': 2.081}, {'end': 380.835, 'text': 'now This is leaf node.', 'start': 378.973, 'duration': 1.862}], 'summary': 'Insert 1 into b-tree, compare from root, insert in leaf node.', 'duration': 68.384, 'max_score': 312.451, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8312451.jpg'}, {'end': 466.374, 'src': 'embed', 'start': 437.373, 'weight': 2, 'content': [{'end': 439.434, 'text': 'after that we will split this note.', 'start': 437.373, 'duration': 2.061}, {'end': 445.979, 'text': 'okay, now, seven can be inserted at this place before nine, because seven is less than nine, less than 13 and less than 21.', 'start': 439.434, 'duration': 6.545}, {'end': 454.747, 'text': 'obviously at this place 7, but we cannot insert 7 at this place.', 'start': 445.979, 'duration': 8.768}, {'end': 455.147, 'text': 'why so?', 'start': 454.747, 'duration': 0.4}, {'end': 459.43, 'text': 'because maximum key any node can hold is 3 only.', 'start': 455.147, 'duration': 4.283}, {'end': 461.431, 'text': 'so splitting would be done.', 'start': 459.43, 'duration': 2.001}, {'end': 462.472, 'text': 'now, splitting, kaise hogi?', 'start': 461.431, 'duration': 1.041}, {'end': 463.833, 'text': 'aapki wahi hai middle element.', 'start': 462.472, 'duration': 1.361}, {'end': 466.374, 'text': 'find out karna padega aapko now, yaha pe humne kya liya tha.', 'start': 463.833, 'duration': 2.541}], 'summary': 'Node can hold maximum 3 keys, splitting is necessary, middle element is key.', 'duration': 29.001, 'max_score': 437.373, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8437373.jpg'}], 'start': 312.451, 'title': 'B-tree insertion process', 'summary': 'Explains the process of inserting nodes into a b-tree, detailing comparisons and proper positioning, with a maximum key limit of 3 per node.', 'chapters': [{'end': 486.744, 'start': 312.451, 'title': 'B-tree insertion process', 'summary': 'Explains the process of inserting nodes into a b-tree, detailing comparisons and proper positioning, with a maximum key limit of 3 per node.', 'duration': 174.293, 'highlights': ['The process of inserting nodes into a B-tree involves comparing the new node value with existing nodes starting from the root node, and then finding the appropriate leaf node for insertion.', 'The maximum key limit for any node in the B-tree is 3, leading to the need for node splitting when the limit is reached.', 'Detailed explanation of the comparisons and proper positioning of new nodes in the B-tree, considering the properties of the existing nodes and the maximum key limit of 3.']}], 'duration': 174.293, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8312451.jpg', 'highlights': ['The process of inserting nodes into a B-tree involves comparing the new node value with existing nodes starting from the root node, and then finding the appropriate leaf node for insertion.', 'Detailed explanation of the comparisons and proper positioning of new nodes in the B-tree, considering the properties of the existing nodes and the maximum key limit of 3.', 'The maximum key limit for any node in the B-tree is 3, leading to the need for node splitting when the limit is reached.']}, {'end': 922.522, 'segs': [{'end': 524.296, 'src': 'embed', 'start': 486.904, 'weight': 3, 'content': [{'end': 491.345, 'text': 'So where will 9 go? To its parent node of this node.', 'start': 486.904, 'duration': 4.441}, {'end': 493.106, 'text': 'And you can say one level up.', 'start': 491.365, 'duration': 1.741}, {'end': 496.126, 'text': 'So where should 9 go? Here at 5.', 'start': 493.426, 'duration': 2.7}, {'end': 497.947, 'text': 'And we can insert 9 at this place.', 'start': 496.126, 'duration': 1.821}, {'end': 501.408, 'text': "Because we can't have a maximum key of 3 and we have only one key.", 'start': 498.207, 'duration': 3.201}, {'end': 509.184, 'text': 'Now the tree would be 5 and 9.', 'start': 501.988, 'duration': 7.196}, {'end': 514.328, 'text': 'Left part of 5 is 1, 2 and 3.', 'start': 509.184, 'duration': 5.144}, {'end': 520.332, 'text': 'See 9 if one level goes up means this node would be splitted in two parts.', 'start': 514.328, 'duration': 6.004}, {'end': 524.296, 'text': "So 9's left child would be 7.", 'start': 520.393, 'duration': 3.903}], 'summary': "Inserting node 9 into the tree at node 5, resulting in a tree with 5 and 9 as keys, and 9's left child as 7.", 'duration': 37.392, 'max_score': 486.904, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8486904.jpg'}, {'end': 651.747, 'src': 'heatmap', 'start': 626.078, 'weight': 0, 'content': [{'end': 627.919, 'text': 'Then this node will be split in two parts.', 'start': 626.078, 'duration': 1.841}, {'end': 630.461, 'text': '10 would be the left child of 12.', 'start': 627.939, 'duration': 2.522}, {'end': 633.823, 'text': 'Okay What will remain on the left side of 12? Only 10.', 'start': 630.461, 'duration': 3.362}, {'end': 641.649, 'text': 'And what will remain on the right side of 12? 13 and 21.', 'start': 633.823, 'duration': 7.826}, {'end': 642.51, 'text': 'Okay Right side of 12.', 'start': 641.649, 'duration': 0.861}, {'end': 651.747, 'text': 'Now next is 4.', 'start': 642.51, 'duration': 9.237}], 'summary': 'Node split into left and right: 10 left child of 12, right side has 13 and 21, next is 4.', 'duration': 36.937, 'max_score': 626.078, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8626078.jpg'}, {'end': 805.243, 'src': 'heatmap', 'start': 776.276, 'weight': 0.776, 'content': [{'end': 785.08, 'text': 'What will be the right children of 2? 3 and 4.', 'start': 776.276, 'duration': 8.804}, {'end': 785.4, 'text': 'Now see.', 'start': 785.08, 'duration': 0.32}, {'end': 787.381, 'text': 'Where will 7 go? 7 is greater than 5.', 'start': 785.42, 'duration': 1.961}, {'end': 789.022, 'text': 'So it should go in the right part of 5.', 'start': 787.381, 'duration': 1.641}, {'end': 790.503, 'text': 'But it is in the left part of 9.', 'start': 789.022, 'duration': 1.481}, {'end': 791.003, 'text': 'So 9 is here.', 'start': 790.503, 'duration': 0.5}, {'end': 805.243, 'text': 'So what will happen in the left part of 9? Now 10 is the right children of this 9.', 'start': 791.023, 'duration': 14.22}], 'summary': '9 is the parent of 7 and 10 in a binary tree.', 'duration': 28.967, 'max_score': 776.276, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8776276.jpg'}, {'end': 902.839, 'src': 'embed', 'start': 871.853, 'weight': 1, 'content': [{'end': 872.784, 'text': '8 is greater than 7.', 'start': 871.853, 'duration': 0.931}, {'end': 877.186, 'text': 'so where is your 8 inserted at this place?', 'start': 872.784, 'duration': 4.402}, {'end': 879.087, 'text': 'fine, next is not there.', 'start': 877.186, 'duration': 1.901}, {'end': 882.549, 'text': 'so this is the final B tree of order.', 'start': 879.087, 'duration': 3.462}, {'end': 888.412, 'text': '4. fine, another variant is say, this is also right.', 'start': 882.549, 'duration': 5.863}, {'end': 893.112, 'text': 'another variant is that right biased tree.', 'start': 888.412, 'duration': 4.7}, {'end': 902.839, 'text': 'you can take this 9 as a, you know, middle part and you can put 9 at this place, 3, 5 at this place and 21 at this place.', 'start': 893.112, 'duration': 9.727}], 'summary': 'The b tree of order 4 contains 8, 9, 3, 5, and 21.', 'duration': 30.986, 'max_score': 871.853, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8871853.jpg'}], 'start': 486.904, 'title': 'B-tree insertion and splitting', 'summary': 'Explains the process of b-tree insertion and splitting, demonstrating the insertion of key values 9, 10, 12, 4, 2, 7, and 8, and the subsequent splitting and rearranging of nodes to maintain the b-tree structure.', 'chapters': [{'end': 922.522, 'start': 486.904, 'title': 'B-tree insertion and splitting', 'summary': 'Explains the process of b-tree insertion and splitting, demonstrating the insertion of key values 9, 10, 12, 4, 2, 7, and 8, and the subsequent splitting and rearranging of nodes to maintain the b-tree structure.', 'duration': 435.618, 'highlights': ['The process of inserting key value 9 is explained, demonstrating the splitting of nodes and the rearrangement of the tree to accommodate the new key value.', 'The insertion of key value 10 is detailed, showcasing the decision-making process and the resulting rearrangement of nodes to maintain the B-tree structure.', "The insertion of key value 12 is outlined, illustrating the splitting of nodes and the subsequent rearrangement to ensure the B-tree's adherence to the maximum key limit.", "The insertion of key value 4 is described, highlighting the splitting of nodes and the rearrangement process necessary to maintain the B-tree's structural integrity.", 'The process of inserting key value 2 is explained, emphasizing the splitting of nodes and the subsequent rearrangement required to adhere to the maximum key limit and B-tree structure.', 'The insertion of key value 7 is detailed, showcasing the decision-making process and the rearrangement of nodes to maintain the B-tree structure.', "The proper positioning and insertion of key value 8 is discussed, emphasizing the decision-making process and the adherence to the B-tree's leaf node insertion rule."]}], 'duration': 435.618, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aNU9XYYCHu8/pics/aNU9XYYCHu8486904.jpg', 'highlights': ["The insertion of key value 12 is outlined, illustrating the splitting of nodes and the subsequent rearrangement to ensure the B-tree's adherence to the maximum key limit.", 'The process of inserting key value 10 is detailed, showcasing the decision-making process and the resulting rearrangement of nodes to maintain the B-tree structure.', "The proper positioning and insertion of key value 8 is discussed, emphasizing the decision-making process and the adherence to the B-tree's leaf node insertion rule.", 'The insertion of key value 9 is explained, demonstrating the splitting of nodes and the rearrangement of the tree to accommodate the new key value.', 'The insertion of key value 7 is detailed, showcasing the decision-making process and the rearrangement of nodes to maintain the B-tree structure.', "The insertion of key value 4 is described, highlighting the splitting of nodes and the rearrangement process necessary to maintain the B-tree's structural integrity.", 'The process of inserting key value 2 is explained, emphasizing the splitting of nodes and the subsequent rearrangement required to adhere to the maximum key limit and B-tree structure.']}], 'highlights': ['The maximum keys any node can have in a B tree of order 4 is 3, providing a clear understanding of the structure and organization of the tree.', 'The process of inserting numbers into the B tree is detailed, focusing on maintaining ascending order and managing node capacity.', 'The concept of finding the middle element in a node and its impact on creating left and right biased trees is thoroughly explained, offering insights into the decision-making process during the tree construction.', 'The process of inserting nodes into a B-tree involves comparing the new node value with existing nodes starting from the root node, and then finding the appropriate leaf node for insertion.', 'Detailed explanation of the comparisons and proper positioning of new nodes in the B-tree, considering the properties of the existing nodes and the maximum key limit of 3.', 'The maximum key limit for any node in the B-tree is 3, leading to the need for node splitting when the limit is reached.', "The insertion of key value 12 is outlined, illustrating the splitting of nodes and the subsequent rearrangement to ensure the B-tree's adherence to the maximum key limit.", 'The process of inserting key value 10 is detailed, showcasing the decision-making process and the resulting rearrangement of nodes to maintain the B-tree structure.', "The proper positioning and insertion of key value 8 is discussed, emphasizing the decision-making process and the adherence to the B-tree's leaf node insertion rule.", 'The insertion of key value 9 is explained, demonstrating the splitting of nodes and the rearrangement of the tree to accommodate the new key value.', 'The insertion of key value 7 is detailed, showcasing the decision-making process and the rearrangement of nodes to maintain the B-tree structure.', "The insertion of key value 4 is described, highlighting the splitting of nodes and the rearrangement process necessary to maintain the B-tree's structural integrity.", 'The process of inserting key value 2 is explained, emphasizing the splitting of nodes and the subsequent rearrangement required to adhere to the maximum key limit and B-tree structure.']}