Archive of posts with category 'Medium'

Count Complete Tree Nodes

According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible....

Binary Tree Right Side View

Today we will discuss another Binary Tree problem.

Level Order Traversal of Binary Tree

A binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. Today...

Find First and Last Position of Element in Sorted Array

Binary Search is a specialized algorithm compared to a normal sequential search. The concept of Binary Search is to search for the element very efficiently by dividing the input into...

Kth Largest Element in an Array

Today we are going to discuss another LeetCode problem.

Minimum Remove to Make Valid Parentheses

Stack is another important data structure. The parentheses validity check is a classic question that can be solved using a stack. It’s by pushing the opening parentheses to stack and...

Cycle Detection in a Linked List

Today we are going to solve a very interesting concept in linked lists that is cycle detection. There is a cycle in a linked list if there is some node...

Flatten a Multilevel Doubly Linked List

We have already familiarised ourselves with linked lists and today we’ll try to solve another linked list problem.

Reverse A Portion of The Linked List

The linked list is another interesting data structure in Computer Science. They are similar to arrays but instead of storing data in consecutive memory locations in a linked list the...

Longest Substring Without Repeating Characters

Today, I’m going to try to solve another string problem which is a medium complex problem from LeetCode. The Problem

Container with most water problem

Today we are going to discuss another array-based question which is going to be a little bit tougher than the previous one.