MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / my_queue

Class my_queue

data_structures/binary tree/AVLtree.py:7–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import math
6import random
7class my_queue:
8 def __init__(self):
9 self.data = []
10 self.head = 0
11 self.tail = 0
12 def isEmpty(self):
13 return self.head == self.tail
14 def push(self,data):
15 self.data.append(data)
16 self.tail = self.tail + 1
17 def pop(self):
18 ret = self.data[self.head]
19 self.head = self.head + 1
20 return ret
21 def count(self):
22 return self.tail - self.head
23 def print(self):
24 print(self.data)
25 print("**************")
26 print(self.data[self.head:self.tail])
27
28class my_node:
29 def __init__(self,data):

Callers 1

traversaleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected