From the course: Nail Your Java Interview

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Mastering linked lists for whiteboard coding interviews

Mastering linked lists for whiteboard coding interviews - Java Tutorial

From the course: Nail Your Java Interview

Start my 1-month free trial

Mastering linked lists for whiteboard coding interviews

- [Instructor] Depending on the technical interview question, you may want to organize your data in a linked list. A linked list is a linear data structure where elements containing data of the same type are linked using pointers. This allows us to easily modify and retrieve data in a sequential manner. Each element in the linked list is called a node, and it contains data along with the pointer, pointing to the next element in the linked list. If the next pointer is null, then the given node must be the last element in the list. We often call the first item of a linked list the head of the list, and the last item the tail. So how is this different from an array? Since the elements are connected by pointers, the items do not need to be stored at contiguous memory locations. This means insertion and deletion are less expensive. With these pointers, we can also have singly-linked lists or doubly-linked lists.…

Contents