Merge pull request #13484 from Manish-Giri/fix/fix-instructions-doubly-linked-list

Fix description in create linked list
This commit is contained in:
Samuel Plumppu
2017-02-21 09:07:36 +01:00
committed by GitHub

View File

@ -1292,10 +1292,11 @@
"id": "587d825a367417b2b2512c87",
"title": "Create a Doubly Linked List",
"description": [
"All of the linked lists we've created so far are singly linked lists. Here, we'll create",
"a doubly linked list. As the name implies, nodes in a doubly linked list have references to the next and previous node in the list. This allows us to traverse the list in both directions but it also requires more memory to be used because every node must contain an additional reference to the previous node in the list.",
"Instructions: We've provided a Node object and started our DoublyLinkedList. Let's",
"add two methods to our doubly linked list called add and remove. The add method should accept integers or strings and add them to the list and remove should accept an integer or string and remove all copies of this integer or string that exist in the list. Be careful to handle any possible edge cases when writing these methods, such as deletions for the first or last element. Also, removing any item on an empty list should return null."
"All of the linked lists we've created so far are singly linked lists. Here, we'll create a <dfn>doubly linked list</dfn>. As the name implies, nodes in a doubly linked list have references to the next and previous node in the list.",
"This allows us to traverse the list in both directions but it also requires more memory to be used because every node must contain an additional reference to the previous node in the list.",
"<hr>",
"We've provided a <code>Node</code> object and started our <code>DoublyLinkedList</code>. Let's add two methods to our doubly linked list called <code>add</code> and <code>remove</code>. The <code>add</code> method should add the given element to the list while the <code>remove</code> method should remove all occurrences of a given element in the list.",
"Be careful to handle any possible edge cases when writing these methods, such as deletions for the first or last element. Also, removing any item on an empty list should return <code>null</code>."
],
"challengeSeed": [
"var Node = function(data, prev) {",