"We can use a pool of memory where each index we can store the parent of current index then we can use same lca approach for array instead of pointers."
Sourav K. - "We can use a pool of memory where each index we can store the parent of current index then we can use same lca approach for array instead of pointers."See full answer
"Classes are represented in memory as areas where code and class shared objects are. The JVM use class loader to load classes and unload them if no more required at runtime as specified at https://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.7, to name a very consolidated version of JVM. The interviewers supposed memory was freed without being subject to GC. I asked to discuss to clarify which hypothesis is right, the interviewers dismissed me. I'm very happy they didn't select m"
Luca D. - "Classes are represented in memory as areas where code and class shared objects are. The JVM use class loader to load classes and unload them if no more required at runtime as specified at https://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.7, to name a very consolidated version of JVM. The interviewers supposed memory was freed without being subject to GC. I asked to discuss to clarify which hypothesis is right, the interviewers dismissed me. I'm very happy they didn't select m"See full answer
"The height of a binary tree is the maximum number of edges from the root node to any leaf node. To calculate the height of a binary tree, we can use a recursive approach. The basic idea is to compare the heights of the left and right subtrees of the root node, and return the maximum of them plus one."
Prashant Y. - "The height of a binary tree is the maximum number of edges from the root node to any leaf node. To calculate the height of a binary tree, we can use a recursive approach. The basic idea is to compare the heights of the left and right subtrees of the root node, and return the maximum of them plus one."See full answer