mihirk
BAN USER- 0of 0 votes
AnswersGiven (i) a non-empty binary search tree with double values (e.g. 3.5) in each node and (ii) a key value K
- mihirk in United States
Write a method to find the closest value to K.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Coding Data Structures Java Trees and Graphs - 0of 0 votes
AnswersWhat is the use of interfaces in Java?
- mihirk in United States for Cloud Resource Management
Give a professional answer and not a simple one like they are used in place of multiple inheritance or they facilitate OOP in Java, etc..
Also can you do without interfaces?| Report Duplicate | Flag | PURGE
VMWare Inc Software Engineer / Developer Java - 0of 0 votes
AnswersGive logic for implementing "diff" command in Linux.
- mihirk in United States for Cloud Resource Management
Consider various test cases and explain what will happen in each. The two files are source code and are huge..
For e.g.
File 1: 1-2-3-4
File 2: 1-3-4-2| Report Duplicate | Flag | PURGE
VMWare Inc Software Engineer / Developer Algorithm Coding Data Structures Ideas Application / UI Design
This method below is not giving correct paths. Can someone please tell me the mistake.
public static void paths(Node node, LinkedList<Integer> list) {
if(node == null) return;
list.add(node.data);
if(node.left == null && node.right == null) {
print(list);
}
else {
paths(node.left, list);
paths(node.right, list);
}
}
public static void print(LinkedList<Integer> list) {
System.out.println("Contents of list: " + list);
}
e.g:
7
/
2
/ \
1 5
It prints:
7 2 1
7 2 1 5
- mihirk March 02, 2014