AfterAcademy Tech
Given a binary tree, write a program to return the average value of the nodes on each level in the form of an array. The range of the node's value is in the range of 32-bit signed integer.
Given a binary tree, write a program to find the maximum depth of the binary tree. The maximum depth is the number of nodes along the longest path from the root node to the leaf node. A leaf is a node with no child nodes.
Design and implement a data structure for Least Recently Used(LRU) cache. Your data structure must support two operations: get(key) and put(). The problem expects a constant time solution
Given a string str, containing digits from 2 - 9 inclusive, write a program to return all the possible letter combinations that the number could represent. This is a popular coding interview question based on backtracking and recursive approach.
Given a stack of integers st, write a program to reverse the stack using recursion. This problem will clear the concept of recursion.
Given an integer K and queue Q of integers. Write a program to reverse the order of the first K elements of the queue. The other elements will be in the same relative order.
Given two sequences pushed and popped with distinct values, write a program to return true if and only if this could have been the result of a sequence of push and pop operations on an initially empty stack.
Given a 2-D matrix board where every element is either 'O' or 'X', write a program to replace 'O' with 'X' if surrounded by 'X'. It is a famous problem based on the concept of flood fill algorithms
Write a program for the recursive implementation of Insertion Sort. Insertion Sort is used to sort a given array. This problem will sharpen your recursion skills.
In which situation 2 dimensional DP can be dropped to 1 dimension? Is there any principle or regular pattern? This is a very important question when it comes to optimization of DP arrays. Let's find out.