Data Structure Implementation using Java