Category: algorithms
Given a BST (Binary Search Tree) with duplicates, find its mode(s) – the most frequently occurred element. A BST has the following characteristics: The left subtree of a node …
Given a binary tree, compute the average values for the nodes on each level and return them in the form of an array. For example: Input: 3 / \ …
A Queue implements First In First Out while a Stack is First In Last Out. It is possible to implement a queue using two stacks. When an item is …
Similar to Parity Sorting, the Index Parity Sorting can be applied to an array of integers that have equal number of even numbers and odd numbers. You are to …
Given a list of sorted array containing only lowercase letters, and a target letter, your task is to find the smallest letter in the list that is greater than …