Loading tutorials
Intermediate · Mid: 14 chapters · 34 min read. States assumed prerequisites
Start readingwhile loops, and introductory Big-O. It also assumes you have seen the Node class and the LinkedList class with a head field from the previous chapter.Node and LinkedList classes from earlier chapters, know that head is a reference to the first node (or None), and understand O(1) versus O(n). Insertion in a singly linked list always comes down to one thing: choosing the order in which you change refereNode and LinkedList classes and walk it with a loop. Here you will remove a node by value and handle each edge case.push_front, append, and delete_value, and that you know Big-O notation at an introductory level. Here you compare that structure with an array, using Python's list as the array. Python's list is a dynamic array: it keeps its elemNode and LinkedList classes, traverse it, and delete a value by fixing next references. It also assumes you know introductory Big-O. If delete_value from the previous chapter felt full of special cases, this chapter shows how to reNode and LinkedList classes from earlier chapters, that you can traverse a list with a while loop, and that you know O(n) and O(1) notation. You will learn how to reverse a singly linked list by changing its links, without copying any values.Node objects, as in the earlier chapters, and that you know Big-O notation at an introductory level. Here you will learn the two-pointer technique: walking a list with two references that move at different speeds.push_front, append, and delete_value, and that you know why deleting needs the node before the target. It also assumes you know introductory Big-O.head is the entry point and that None marks the end of a chain.Node objects and a next reference, and that you know the idea of slow and fast pointers from the previous chapter. It also assumes introductory Big-O.