The Data structure problems using Java