binary search tree

PPTX 22 стр. 169,9 КБ Бесплатная загрузка

Предварительный просмотр (5 стр.)

Прокрутите вниз 👇
1 / 22
binary search tree binary search tree algorithms and data structures course binary search tree binary search tree is a binary tree data structure which has the following properties: the left subtree of a node contains only nodes with keys lesser than the node’s key. the right subtree of a node contains only nodes with keys greater than the node’s key. the left and right subtree each must also be a binary search tree. algorithms and data structures course binary search tree searching a key: implementation to search a given key in binary search tree, we first compare it with root, if the key is present at root, we return root. if key is greater than root’s key, we recur for right subtree of root node. otherwise we recur for left subtree. algorithms and data structures course binary search tree searching a key: example algorithms and data structures course 7 8 …
2 / 22
f a key: example we want to insert 4. we compare 4 with 8: 8 is greater, so continue in left subtree. algorithms and data structures course 8 9 2 1 3 binary search tree insertion of a key: example we want to insert 4. we compare 4 with 8: 8 is greater, so continue in left subtree. we compare 4 with 2: 2 is smaller, so continue in right subtree. algorithms and data structures course 8 9 2 1 3 binary search tree insertion of a key: example we want to insert 4. we compare 4 with 8: 8 is greater, so continue in left subtree. we compare 4 with 2: 2 is smaller, so continue in right subtree. we compare 4 with 3: 3 is smaller, so continue in right subtree. algorithms and data structures course 8 9 2 1 3 binary search tree insertion of a key: …
3 / 22
e child to the node and delete the child. algorithms and data structures course 8 9 2 1 4 binary search tree deletion of a key when we delete a node, three possibilities arise: third, node to be deleted has two children: algorithms and data structures course 8 9 2 1 3 4 binary search tree deletion of a key when we delete a node, three possibilities arise: third, node to be deleted has two children: find inorder successor of the node. copy contents of the inorder successor to the node and recursive delete the inorder successor. note that inorder predecessor can also be used. algorithms and data structures course 8 9 2 1 3 4 binary search tree deletion of a key when we delete a node, three possibilities arise: third, node to be deleted has two children: find inorder successor of the node. copy contents of the inorder …
4 / 22
binary search tree - Page 4
5 / 22
binary search tree - Page 5

Хотите читать дальше?

Скачайте все 22 страниц бесплатно через Telegram.

Скачать полный файл

О "binary search tree"

binary search tree binary search tree algorithms and data structures course binary search tree binary search tree is a binary tree data structure which has the following properties: the left subtree of a node contains only nodes with keys lesser than the node’s key. the right subtree of a node contains only nodes with keys greater than the node’s key. the left and right subtree each must also be a binary search tree. algorithms and data structures course binary search tree searching a key: implementation to search a given key in binary search tree, we first compare it with root, if the key is present at root, we return root. if key is greater than root’s key, we recur for …

Этот файл содержит 22 стр. в формате PPTX (169,9 КБ). Чтобы скачать "binary search tree", нажмите кнопку Telegram слева.

Теги: binary search tree PPTX 22 стр. Бесплатная загрузка Telegram