Selection Sort in Python

Today we will learn a simple and easy to visualize sorting algorithm called the Selection Sort in Python. Let’s get started. The Selection Sort Algorithm Similar to Insertion Sort, the insertion sort algorithm divides the list into two parts. The first part at the beginning of the list is the sorted part and the second […]

Selection Sort in Python Read More »

Insertion Sort in Python

In this tutorial, we will learn about insertion sort in Python, a sorting algorithm that works very similar to how we sort things in real life. Let’s get started. The Insertion Sort Algorithm If you have a set of cards numbered 1 to 10 which are shuffled, and you’re asked to sort them, you will

Insertion Sort in Python Read More »

Bubble Sort in Python

Let’s study one of the most intuitive and easiest to learn sorting algorithms, and implement Bubble Sort in Python. We’ll start by understanding sorting itself, and then we’ll get to sorting via bubble sort, and finally, we’ll see how to implement it in Python. Importance of Sorting Algorithms What is sorting? And why is it

Bubble Sort in Python Read More »

Semicolon in Python

The common meaning of a semicolon(;) in various programming languages is to end or discontinue the current statement. In programming languages such as C, C++, and Java, it is necessary to use a semicolon to end a line of code. However, this is not the case with Python. A semicolon in Python signifies separation rather

Semicolon in Python Read More »

Postorder Tree Traversal in Python

In this article, we will study the concept and algorithm for postorder tree traversal. Then we will implement the algorithm for postorder traversal in python and run it on a binary tree. What is Postorder Tree Traversal? Postorder traversal is a depth-first tree traversal algorithm. In depth-first traversal, we start at the root node and

Postorder Tree Traversal in Python Read More »

Preorder Tree Traversal in Python

In this article, we will study the concept and algorithm for preorder tree traversal. Then we will implement the algorithm for preorder traversal in Python and run it on a binary tree. What is Preorder Tree Traversal? Preorder traversal is a depth-first tree traversal algorithm. In depth-first traversal, we start at the root node and

Preorder Tree Traversal in Python Read More »