Important Java Interview Questions - Part 4

I'm sharing my experience with you as these are the questions which have been asked to me while interviewing on java profile.


What is the impelementation of linkedlist in java?

Singly Linked Lists are a type of data structure. It is a type of List. In a singly linked list each node in the list stores the contents of the node and a pointer or reference to the next node in the list.

Here is the pictorial view of singly linked list:


A doubly-linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains two fields, called links, that are references to the previous and to the next node in the sequence of nodes.

This structure allows for efficient insertion or removal of elements from any position in the sequence. In a doubly linked list each node has two links one pointing to the next node in the list and one pointing to the previous node in the list.

Here is the pictorial view of doubly linked list:


Here is a pictorial view of inserting an element in doubly linked list


Here is a pictorial view of deleting an element in doubly linked list


                                                                                               
If you still have any question you can reach me any time through email (jigyasu2010@hotmail.com)


Comments

Popular posts from this blog

How Method Overloading Helping in Java - Part 9

Design Patterns -- part 1

Access Modifiers in java