Skip to content

Instantly share code, notes, and snippets.

@ldclakmal
Created June 6, 2020 15:01
Show Gist options
  • Save ldclakmal/3f3acb46d5bb6532f569b1f13cd98823 to your computer and use it in GitHub Desktop.
Save ldclakmal/3f3acb46d5bb6532f569b1f13cd98823 to your computer and use it in GitHub Desktop.
Linked List API of Ballerina
public type Node record {|
any value;
Node? prev = ();
Node? next = ();
|};
public type LinkedList record {
Node? head;
Node? tail;
};
public function addLast(LinkedList list, Node node);
public function addFirst(LinkedList list, Node node);
public function remove(LinkedList list, Node node);
public function removeLast(LinkedList list) returns Node?;
public function clear(LinkedList list);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment