In this video we have covered linked list coding interview questions which has been asked in Adobe, Amazon, Flipkart, GE, Hike and many more other companies .
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
https://openinapp.co/udemycourse
Course Description Video :
https://yt.openinapp.co/dmjvd
Linked List is a part of the Collection framework present in java.util package. This class is an implementation of the LinkedList data structure which is a linear data structure where the elements are not stored in contiguous locations and every element is a separate object with a data part and address part. The elements are linked using pointers and addresses. Each element is known as a node.
The LinkedList stores its items in "containers." The list has a link to the first container and each container has a link to the next container in the list. To add an element to the list, the element is placed into a new container and that container is linked to one of the other containers in the list.
Things to Remember about Linked List
1) head points to the first node of the linked list
2) next pointer of the last node is NULL, so if the next current node is NULL, we have reached the end of the linked list.
Displaying the contents of a linked list is very simple. We keep moving the temp node to the next one and display its contents
Insert at the End of linked list
1_ Allocate memory for new node
2) Store data
3) Traverse to last node
4) Change next of last node to recently created node
they are linked with each other using pointers. Each element of the LinkedList has the reference(address/pointer) to the next element of the LinkedList.
Each element in the LinkedList is called the Node. Each Node of the LinkedList contains two items: 1) Content of the element 2) Pointer/Address/Reference to the Next Node in the LinkedList.
Given a singly linked list, find the middle of the linked list. For example, if the given linked list is 1-2-3-4-5 then the output should be 3.
If there are even nodes, then there would be two middle nodes, we need to print the second middle element. For example, if given linked list is 11-2-3-4-5-6 then the output should be 4.
Given a linked list, check if the linked list has loop or not.
Most Asked Core Java Interview Questions and Answers : • Core Java frequently asked Interview ...
Advance Java Interview Questions and Answers : • Advance Java Interview Questions
Java 8 Interview Questions and Answers : • Java 8 Interview Questions(New Features)
Hibernate Interview Questions and Answers : • Hibernate Interview Questions Java
Spring Boot Interview Questions and Answers : • Advance Java Interview Questions
Angular Playlist : • Angular Course Introduction || Angular 8
SQL Playlist : • SQL Interview Questions and Answers
GIT : • GIT
Subscriber and Follow Code Decode
Subscriber Code Decode : https://www.youtube.com/c/CodeDecode?...
LinkedIn : / codedecodeyoutube
Instagram : / codedecode25
#codedecode #linkedlist #middlenodeinlinkedlist