Java67
Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
How to implement Linear Search Algorithm in Java? Example tutorial
How to implement Radix Sort in Java - Algorithm Example [Solved]
How to implement Merge Sort Algorithm in Java [Solved] - Example Tutorial
Counting Sort in Java - Example
Top 22 Array Concepts Interview Questions Answers in Java
How to use Deque Data Structure in Java? Example Tutorial
How to find Kth Smallest Element in a Binary Search Tree? [Solved]
How to find the maximum sum level in binary tree in Java? Example Tutorial
How to Find Lowest Common Ancestor of a Binary Tree in Java? Example Tutorial
Hello guys, if you are wondering how to find the lowest common ancestor of a binary tree in Java then you are at the right place. Earlier, I have shared 40+ binary tree questions and today I am going to share solution of one of the popular binary tree question here. To find the lowest common ancestor of a binary tree in java requires that we run through a binary search tree and how it operates. What then is a binary search tree? A Binary tree is a data structure in which each node can have at most two children. That is, each node in the binary tree will have data, left child and right child. The first node of the tree is called the Root.
How to get the first and last item in an array in Java? Example Tutorial
Difference between array and Hashtable or HashMap in Java
A couple of days back someone asked me about the difference between an array and a hashtable, though this is a generic data structure and programming question, I'll answer it from both a general programming perspective as well on Java perspective where Hashtable is not just a data structure but also a class from Java Collection API. Even though both array and hashtable data structure are intended for fast search i.e. constant time search operation also known as O(1) search, the fundamental difference between them is that array require an index while hash table requires a key which could be another object.