Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 781 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 781 Bytes

JS Linked List Implementation

Includes: Node and LinkedList classes

LinkedList functions:

  • append (int value, Node next = undefined) Appends node to the end of the list. Returns string interpretation of new list.

  • build_linked_list (Array data) Creates a LinkedList from data in the given array. Returns new LinkedList.

  • insert (int index, int value) Inserts value at given index. Returns string interpretation of new list.

  • len () Returns number of nodes in list

  • print_linked_list

  • remove (int value) Removes first occurrence of value. Returns string interpretation of list.

  • removeIndex (int index) Removes node at index. Returns string interpretation of list.

Sorting Algorithms:

  • inssort = Insertion Sort
  • mergesort = Merge Sort
  • selsort = Selection Sort