Created
June 6, 2020 15:01
-
-
Save ldclakmal/3f3acb46d5bb6532f569b1f13cd98823 to your computer and use it in GitHub Desktop.
Linked List API of Ballerina
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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