Skip to content

Instantly share code, notes, and snippets.

View jettify's full-sized avatar
🇺🇦

Nikolay Novik jettify

🇺🇦
View GitHub Profile
@jettify
jettify / gist:4354883
Last active December 10, 2015 00:58
My codingforinterviews task

Explain what a binary search tree is and what to consider when implementing one.

Binary search tree (BST) can be represented by a linked data structure. Each node contains key value, data and references to left and right subtree. BST has following properties:

  1. Left subtree of a node contains only nodes with keys less than the node's key.
  2. Right subtree of a node contains only ondes with keys greater than the node's key.
  3. Left and Right subtrees are also binary search trees.