Data Structures and Algorithms

Dijkstra’s algorithm to find the shortest path
Let’s imagine you and your best friend live quite far apart, you haven’t seen him for a while, your best friend is organizing a party at his house and you’re […]

AOC 2022 – Day 5: Supply Stacks
You can read the full description for day 5 here. In summary for part 1, we have been provided a number of stacks, each stack may contain a number of […]

Introduction to Trie Data Structure
Trie is a data structure that is not so popular but is particularly useful when you have to work a lot with strings. It also has different names like a […]

Quicksort algorithm – Lomuto partition scheme
There are a multifarious number of sorting algorithms have been proposed and being used nowadays. Perhaps you’re already familiar with some sorting algorithms such as Bubble Sort, Selection Sort, or […]

905. Sort Array By Parity – Inplace Solution  LeetCode Problem
Given an array A of nonnegative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A. You may return any answer array that satisfies […]

Understand Tree Traversal: Preorder, Inorder, and Postorder Traversal
Many of you probably have familiar with arrays or linkedlists, we know that in those data structures, elements can be traversed linearly. But what about the binary tree? As we […]

Binary Search Tree (BST) Concrete Implementation In Java
Binary Search Tree is a fundamental data structure that stores items in the memory. In this article, we will learn what is a binary search tree (BST for short) and […]

Reverse Linked List (LeetCode) – Iterative and recursive implementation
Happy new year, everyone! On the very first day of 2020, let’s jump to a problem that has been asked all the time during the interview – Reverse A Linked […]

Top 150 best practice LeetCode’s problems sorted by difficulties
If you want to sharpen your problemsolving and coding skills, indeed Leetcode is one of the best places that help you do that. This platform empowers programmers to improve their […]

The Algorithm Design Manual – 2nd Edition (free download)
Besides Introduction to Algorithms, The Algorithm Design Manual is another great book in the Competitive Programming community. The Algorithm Design Manual provides straightforward access to combinatorial algorithms technology, stressing design overanalysis. This […]