Share your repls and programming experiences

← Back to all posts
linked list practice tori rudd
torirudd (0)

class Node:
def init(self, data, next=None):
self.data=data
self.next=next

first= Node(3)
print(first.data)

class LinkedList:
def init(self):
self.head = None

LL = LinkedList()
LL.head = Node(3)
print(LL.head.data)

def insert(self, data):
NodeTail = Node(data)
if(self.head):
current = self.head
while(current.next):
current = current.next
current.next = NodeTail
else:
self.head = NodeTail

class Solution {
public:
void deleteNode(ListNode* node) {

}

};

print(list)

for num in list:
if num % 2 != 0:
print(num,end = " ")