How to Implement a Binary Search Tree

Scott Cosentino
Nov 5 · 6 min read

A binary search tree, or BST, is a type of data structure typically used to organize data. It is structured in a very different way compared to stacks, queues and lists. Generally, a BST will have the following properties.

1. The tree has a root node that is used as the starting point for any operation

2. Each node in the tree has one or two nodes attached to it. One is to the right of the node, and the other is to the left.

3. Everything to the right of a node is larger in value compared to it. Everything to the…

Keep the story going. Sign up for an extra free read.

You've completed your member preview for this month, but when you sign up for a free Medium account, you get one more story.
Already have an account? Sign in

Scott Cosentino

Written by

Computer programmer specializing in security. My blog: www.scprogramming.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade