5 - Binary Search Tree - Data Structure - 2101642440 _ Kevin Yohanes

Binary Search Tree (BST)
- hanya memiliki 2 child pada setiap elemen
- tidak boleh terjadi looping
- Setiap elemen memiliki key/value
- Value pada subtree sebelah kiri harus lebih kecil dari value pada root
- Value pada subtree sebelah kanan harus lebih besar dari value pada root

contoh :



Image result for binary search tree




BST atau binary search tree digunakan karena lebih optimal digunakan untuk menambah, menghapus dan mencari data.

insertion in BST



Deletion in BST


Komentar

Postingan populer dari blog ini

1 - Pointer, Array and Introduction to Data Structure - Data Structure - 2101642440 _ Kevin Yohanes

2 - Linked List Implementation - Data Structure - 2101642440 _ Kevin Yohanes