Evaluate a given expression
Given an expression containing numeric operands with addition and subtraction operators, evaluate it. The expression may contain sub-expressions enclosed in opening and closing braces.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven an expression containing numeric operands with addition and subtraction operators, evaluate it. The expression may contain sub-expressions enclosed in opening and closing braces.
A string that may contain multiple consecutive instances of the same value is encoded to only store that value and its count. Given such an encoded sequence, decode it.
Given an integer array, find the previous smaller element for every array element. The previous smaller element of a number x is the first smaller number to the left of x in the array.
Given two binary trees, check whether the leaf traversals of both trees are the same or not.
Construct an expression tree from a given postfix notation and print the infix notation. The binary expression tree is a binary tree whose leaves are operands, such as constants or variable names, and the other nodes contain operators.
Given a level order representation of a complete binary search tree, print its elements in increasing order.
Given a circular integer array, find the next greater element for every element in it. The next greater element of an element x in the array is the first larger number to the next of x.
Given an integer array, find the next greater element for every array element. The next greater element of a number x is the first greater number to the right of x in the array.
Write an efficient algorithm to invert alternate levels of a perfect binary tree.
Given an unsorted integer array, print all greater elements than all elements present to their right.
This post will implement a stack using the queue data structure. In other words, design a stack that supports push and pop operations using standard enqueue and dequeue operations of the queue.
This post will cover the difference between the Depth–first search (DFS) and Breadth–first search (BFS) algorithm used to traverse/search tree or graph data structure.