Trees, Binary Search Trees and traversal methods, the difference and why.

Structure of a Tree

Components of a Tree

  • Binary Trees
  • Binary Search Trees
  • AVL Trees
  • Red-Black Trees
  • 2–3 Trees
  • 2–3–4 Trees
  1. Data
  2. Pointer to the left child
  3. Pointer to the right child

Common operations

Insertion

Deletion

Tree traversal

  1. In-order traversal (Left -> Root -> Right)
  2. Post-order traversal (Left -> Right -> Root)
  3. Pre-order traversal (Root -> Left -> Right)

In-order

Pre-order

Post-order

--

--

--

just a junior developer navigating through problems in Rails and React. I like sharing my solutions, thinking processes and sometimes frustration..

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to generate test files with Python

Using t2.unlimited to Increase Packet Limitations

What does Istio service discovery do?

Docker -> Building a LAMP stack

Route quality metric verification

Shifting Left: DevSecOps as an Approach to Building Secure Products

The DevSecOps approach with security testing and monitoring baked into each step of the process

RabbitMQ: Publish, Consume, and Retry Messages

Managing mobile resources with limited budget in testing

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Saman Batool

Saman Batool

just a junior developer navigating through problems in Rails and React. I like sharing my solutions, thinking processes and sometimes frustration..

More from Medium

Why I Decided To Pursue Software Development

Test Driven Development, Should You or Should You not?

Masters in Embedded Systems — TU Eindhoven

**A Picture is Worth 1,500 Words**