JAVA

LinkedList





JAVA MOD1       course cody

LinkedList

suryansh

cse



  

A linked list is a linear data structure where each element is a separate object. Each element (we will call it a node) of a list is comprising of two items - the data and a reference to the next node. The last node has a reference to null. The entry point into a linked list is called the head of the list. It should be noted that head is not a separate node, but the reference to the first node. If the list is empty then the head is a null reference. A linked list is a dynamic data structure. The number of nodes in a list is not fixed and can grow and shrink on demand. Any application which has to deal with an unknown number of objects will need to use a linked list. One disadvantage of a linked list against an array is that it does not allow direct access to the individual elements. If you want to access a particular item then you have to start at the head and follow the references until you get to that item.



  

1) Declaring and defining a linked LinkedList
2) To add elements to linkedlist
3) To element at particular index in linkedlist



  

1) copying elements to other LinkedList
2) to copy elements at particular Index



  

1)adding element at the first index
2)adding element at the last index



  

1) removing all elements of the linked list



  

1)to check if some element is present in list or Not



  

1)fetching first element of LinkedList
2)fetching the last element of the LinkedList
3)fetching element present at particular Index



  

1)getting index of element
2)getting last index of Element



  

1) to return and remove first element
2) to return and remove last element



  

1)removing first elements
2)removing with the help of Index
3)removing last elements
4)removing first occurance of element
5)removing last occurance of element






other avilable courses

codenody