C
de
S
pace
Explore
Log In
Explore
Sign Up
Log In
dakotanakamura847
22.05.2026 11:14
1
A* pathfinding
From algorithms course
core.py
class Node: def __init__(self, val): self.val = val self.next = None class LinkedList: def __init__(self): self.head = None def append(self, val): if not self.head: self.head = Node(val) return cur = self.head while cur.next: cur = cur.next cur.next = Node(val) def display(self): cur = self.head while cur: print(cur.val, end=' ') cur = cur.next print() ll = LinkedList() ll.append(1); ll.append(2); ll.append(3) ll.display()
Idle
Try It
Clear
Log in
to leave a comment
Are you sure you want to delete this post?
Delete
Cancel