Skip to content

Commit

Permalink
rename Link to Node
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Apr 6, 2024
1 parent d11187e commit 6510f07
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions aheui/aheui.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_location(pc, stackok, is_queue, program):
MINUS1 = bigint.fromlong(-1)


class Link(object):
class Node(object):
"""Element unit for stack and queue."""

def __init__(self, next, value=MINUS1):
Expand Down Expand Up @@ -102,7 +102,7 @@ def __init__(self):

def push(self, value):
# assert(isinstance(value, bigint.Int))
node = Link(self.head, value)
node = Node(self.head, value)
self.head = node
self.size += 1

Expand All @@ -121,22 +121,22 @@ def _put_value(self, value):
class Queue(LinkedList):

def __init__(self):
self.tail = Link(None)
self.tail = Node(None)
self.head = self.tail
self.size = 0

def push(self, value):
# assert(isinstance(value, bigint.Int))
tail = self.tail
tail.value = value
new = Link(None)
new = Node(None)
tail.next = new
self.tail = new
self.size += 1

def dup(self):
head = self.head
node = Link(head, head.value)
node = Node(head, head.value)
self.head = node
self.size += 1

Expand All @@ -156,7 +156,7 @@ def __init__(self):

def push(self, value):
# assert(isinstance(value, bigint.Int))
node = Link(self.head, value)
node = Node(self.head, value)
self.head = node
self.size += 1
self.last_push = value
Expand Down

0 comments on commit 6510f07

Please sign in to comment.