letlist=newLinkedList(...values);// create a linked list
Available Methods
add(value)// Add a Node to the end of listfindNode(val)// Return the first node whose value is equal to input value. If no such node, return null;findeNodes(val)// Return an array of nodes whose value is equal to input value. If no such node, return an empty array findByIndex(index)// Return the Node at certain index. If no such node, return null; deleteNode(val)// Delete the first node whose value is equal to input value. If there is one to delete, return true.If no such node to delete, return false;deleteNodes(val)// Delete all Nodes whose value is equal to input value.If there is one to delete, return true.If no such node to delete, return false;deleteByIndex(index)// Delete Node at certain index. Return true if one node is deleted, false if no node at input index.indexOf(val)// Return the index of the first Node whose value is equal to input value. Return -1 if no such node. reverse()// Reverse the listinsertBefore(val,index)// Insert a Node before the Node at certain index. Return true if success, false if can't find Node at input index.insertAfter(val,index)// Insert a Node after the Node at certain index. Return true if success, false if can't find Node at input index.last()// Return the last nodetoString()// Return a string to show the list.