fix: Correct paths in English exercises by prefixing "/" before "learn" (#38099)
* fix: Correct paths in English exercises by prefixing "/" before "learn" * fix(lang): Correct paths to exercises by prefixing "/" before "learn" in remaining languages
This commit is contained in:
committed by
Randell Dawson
parent
66631812fa
commit
fda7fb174e
@ -10,7 +10,7 @@ forumTopicId: 301711
|
||||
Before we move on to another data structure, let's get a couple of last bits of practice with linked lists.
|
||||
Let's write a <code>removeAt</code> method that removes the <code>element</code> at a given <code>index</code>. The method should be called <code>removeAt(index)</code>. To remove an <code>element</code> at a certain <code>index</code>, we'll need to keep a running count of each node as we move along the linked list.
|
||||
A common technique used to iterate through the elements of a linked list involves a <dfn>'runner'</dfn>, or sentinel, that 'points' at the nodes that your code is comparing. In our case, starting at the <code>head</code> of our list, we start with a <code>currentIndex</code> variable that starts at <code>0</code>. The <code>currentIndex</code> should increment by one for each node we pass.
|
||||
Just like our <code>remove(element)</code> method, which <a href="learn/coding-interview-prep/data-structures/remove-elements-from-a-linked-list" target="_blank">we covered in a previous lesson</a>, we need to be careful not to orphan the rest of our list when we remove the node in our <code>removeAt(index)</code> method. We keep our nodes contiguous by making sure that the node that has reference to the removed node has a reference to the next node.
|
||||
Just like our <code>remove(element)</code> method, which <a href="/learn/coding-interview-prep/data-structures/remove-elements-from-a-linked-list" target="_blank">we covered in a previous lesson</a>, we need to be careful not to orphan the rest of our list when we remove the node in our <code>removeAt(index)</code> method. We keep our nodes contiguous by making sure that the node that has reference to the removed node has a reference to the next node.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
|
Reference in New Issue
Block a user