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 class Node { | |
| int val; | |
| Node next; | |
| public Node(int val) { | |
| this.val = val; | |
| this.next = null; | |
| } | |
| } |
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
| class Node: | |
| def __init__(self, val): | |
| self.val = val | |
| self.next = None | |
| class LinkedList: | |
| def __init__(self): | |
| self.head = None | |
| def add(self, val): |
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
| class Node { | |
| constructor(val) { | |
| this.val = val; | |
| this.next = null; | |
| } | |
| } | |
| class LinkedList { | |
| constructor() { | |
| this.head = null; |
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
| #include <iostream> | |
| using namespace std; | |
| struct Node { | |
| int data; | |
| Node* next; | |
| }; | |
| class LinkedList { | |
| private: |
OlderNewer