MCPcopy Create free account
hub / github.com/acm-clan/algorithm-stone / AlgoQueue

Class AlgoQueue

animations/src/algo_queue.py:5–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3from .algo_vgroup import *
4
5class AlgoQueue(AlgoVGroup):
6 def __init__(self, datas=[], **kwargs):
7 self.datas = datas
8 super().__init__(**kwargs)
9 for k in datas:
10 self.add(AlgoNode(str(k)))
11 self.arrange()
12
13 def size(self):
14 return len(self.datas)
15
16 def push(self, data):
17 self.add(AlgoNode(str(data)))
18 self.datas.append(data)
19 self.arrange()
20
21 def pop(self):
22 self.remove(self.submobjects[0])
23 del self.datas[0]
24 self.arrange()
25
26 def empty(self):
27 return len(self.datas) == 0
28
29
30

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected