Linked ListsLesson 14Free preview
DSA Linked Lists
This lesson is part of DSA · All levels
Summary
A linked list is a linear data structure that stores elements within a node containing data and pointers to the next node. Unlike an array, the elements are not adjacent in memory so insertion and deletion in the middle can be done without moving the elements. However, random access is not available, so searching for the element ke-i requires searching from the head, i.e. O(i).
Key points
- It consists of a node that contains data and a pointer to the next node
- Putting and removing in the middle is cheap, no shifting
- It does not support random access, access to the element ke-i requires O(i)
- It takes extra memory to store the pointers of each node
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.