Linked ListsLesson 17Free preview
Linked Lists Operations
This lesson is part of DSA · All levels
Summary
This section discusses the basic operations of the linked list: inserting nodes in front, center, and back, as well as removing nodes and finding elements. The front insertion only needs O(1) because the changes are limited to the new head and node, whereas operations at a particular position require a search of O(n) first.
Key points
- The front end is costly by updating the pointer head
- Middle pen: search to position and change two pointers
- Delete node: pass the pointer of the previous node to the next node
- Searching for elements requires sequential searching
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.