Binary Tree: A Non-linear  Data Structure (1)

Binary Tree: A Non-linear Data Structure (1)

A Binary Tree is a Tree data structure with two children or less. We commonly refer to them as the left and right child as each element in a binary tree can only have two children.

Representation of a Binary Tree

A pointer to the topmost node of a binary tree serves as its representation. The root’s value is NULL if the tree is empty.

The following components are found in a binary tree node:

  1. Data
  2. Pointer to left child
  3. Pointer to right child

Basic Binary Tree Operation:

  • adding a new element.
  • deleting a component.
  • looking for something.
  • traversing a barrier.

Additional Binary Tree Operation:

  • determining the tree’s height
  • Finding the tree’s level.
  • Finding the size of the entire tree.

Very soon we’ll dive more into the topics ….

要查看或添加评论,请登录

Md Joynul Abedin (Pavel)的更多文章

  • Why Data Structures and Algorithms Are Important ?

    Why Data Structures and Algorithms Are Important ?

    Array, Linked List, Stack, Queues, Searching, Sorting, Tree, Graph… Do you have questions that why should I study all…

  • System Design Cheatsheet

    System Design Cheatsheet

    Basic Steps Clarify and agree on the scope of the system User cases (description of sequences of events that, taken…

  • Linked List or Array ?

    Linked List or Array ?

    Today let's a simple discussion on two very basic and essential linear data structures every programmer should know..

  • Contribution (PR) on GitHub Open Sources

    Contribution (PR) on GitHub Open Sources

    1. Fork the repository Fork the repository by clicking the fork button on the top of the page.

  • Middleware in Express.js

    Middleware in Express.js

    The functions used in the request-response cycle known as middleware have access to the request and response object…

社区洞察

其他会员也浏览了