Here we will explore what binary trees are and see how we can implement binary trees in Python. A basic understanding of programming in Python or any programming language is recommended.

First, we need to understand a tree data structure. Unlike Arrays, Linked Lists, Stacks, and Queues, tree represents a hierarchical data structure. The topmost node in a tree is called root and the elements that are under an element are called its children.

Tree Data Structure

  • Each node (including the root) has a key (value)
  • Each node has only one parent, except the root
  • Each node may have zero…

In this tutorial, you will learn the basics and various functions of NumPy. A basic understanding of Python or any of the programming languages is recommended.

NumPy is a Python package. It stands for Numerical Python. It is a library consisting of multidimensional array objects and a collection of routines for processing of array. These data structures are efficient in performing large size of arrays.

To use any library in the notebook, you can simply use import keyword. Same to import NumPy library. Here is how we import NumPy in Python:

import numpy as np

Creating Ndarray Object

First, let’s…

Myat Mo

Graduate Teaching Assistant at CSE, University of Minnesota. Love to code and share knowledge with others.

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