Problems solved using partitioning logic of Quicksort
This post will discuss a few problems that can be easily solved in linear time and constant space by modifying the partitioning logic of the Quicksort algorithm.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedThis post will discuss a few problems that can be easily solved in linear time and constant space by modifying the partitioning logic of the Quicksort algorithm.
Given a non-negative integer n, print the first n rows of Pascal’s triangle.
Given a string, check if it has a substring that can be used to construct the string by concatenating multiple copies of it.
Given two strings, where the second string is constructed using all characters of the first string except one, find the character that was skipped in the second string.
In this post, we will see how to reverse a doubly linked list using iteration and recursion.
Given an integer array, find an index that divides it into two non-empty subarrays having an equal sum.
This post will discuss how to implement two stacks in a single array efficiently.
Given a linked list of strings, check whether the concatenation of all values in the list together forms a palindrome. It is not permissible to construct a string out of the linked list nodes and check that string for palindrome.
Given a binary tree where each node has one extra pointer next, set it to the inorder successor for all binary tree nodes.
Given a binary tree, efficiently print all nodes between two given levels in a binary tree. The nodes for any level should be printed from left to right.
Given a directed graph and two vertices (say source and destination vertex), determine if the destination vertex is reachable from the source vertex or not. If a path exists from the source vertex to the destination vertex, print it.
Given a binary tree, calculate the difference between the sum of all nodes present at odd levels and the sum of all nodes present at even level.