2. /** * A tournament tree is a binary tree * where the parent is the minimum of the two children. * Given a tournament tree find the second minimum value in the tree. * A node in the tree will always have 2 or 0 children. * Also all leaves will have distinct and unique values. * 2 * / \ * 2 3 * / \ | \ * 4 2 5 3 * * In this given tree the answer is 3. */ class Node { Integer value; Node left, right; Node(Integer value, Node left, Node right) { this.value = value; this.left = left; this.right = right; } } class Solution { /** * This should return the second minimum * int value in the given tournament tree */ public static Integer secondMin(Node root) { } }
Senior Software Interview Questions
99,467 senior software interview questions shared by candidates
1.How to find the nearest parent of any two nodes in a given tree. Tree has mother and father nodes.
Do company tagged leetcode questions.
Q: How would you explain protocol-oriented programming ? Q: Can you explain MVVM? Q: Explain what SOLID is?
find a loop in a list
“You have all of the prices for a given stock for the next year. You can buy once and sell once in that year. How do you determine when to buy and sell to maximize your profit?”
Given a map of integer as key and String as a value, how to efficiently get all the keys whose value consists of certain given input string as a sub-string.
what's the easiest way to access all the diagonal elements of a 3x3 matrix
Write a SQL query to find data above the average of a column.
how to add all the numbers from 1 to N
Viewing 141 - 150 interview questions