Skip to content

Instantly share code, notes, and snippets.

class NotFoundException(Exception):
pass
class Bucket:
def __init__(self):
self.bucket = []
self.size = 0
def __str__(self):
class ArrayDeque():
def __init__(self):
self.size = 0
self.capacity = 4
self.arr = [None] * capacity
def push_back(self,value):
try:
self.arr[size] = self.arr[value]
self.size+1
class ArrayList:
def __init__(self):
self.size = 0
self.capacity = 4
self.Arr = [None]*self.capacity
#self.index = 0
def print_array_list(array_list):
str_val = ""
for i in range(array_list.size - 1):
class ArrayList:
def __init__(self):
self.size = 0
self.capacity = 4
self.Arr = [None]*self.capacity
#self.index = 0
def print_array_list(array_list):
count = 0
while array_list.size != count:
class SLL_Node:
def __init__(self, data, next):
self.data = data
self.next = next
# IMPLEMENT THIS
def average_of_list(head):
if type(head) == float:
return head
#class NotFoundException(Exception):
#pass
class Error(Exception):
pass
class Bucket:
class Node:
def __init__(self,key,data,next = None):
self.key = key
var board =
[['1', '1', '1', '4', '5', '6', '7', '8', '9'],
['2', '2', '2', '3', '.', '.', '9', '.', '.'],
['3', '3', '3', '9', '.', '.', '.', '.', '.'],
['.', '7', '1', '.', '.', '.', '.', '.', '.'],
['.', '.', '.', '.', '.', '.', '.', '.', '8'],
['8', '.', '.', '.', '5', '.', '6', '.', '4'],
['.', '1', '.', '2', '.', '.', '.', '9', '.'],
['2', '.', '.', '.', '.', '4', '.', '.', '.'],
['.', '6', '9', '.', '.', '.', '.', '7', '.']];
select distinct people.id as peopleID, people.name from people where id in
(select distinct peopleid from results where competitionid in
(select id from competitions where held >= '2002-06-01'::date and held < '2002-07-01'::date))
or id in (select distinct peopleid from results where sportid = (select id from sports where name = 'High Jump')
and result = (select record from sports where name = 'High Jump')) order by people.name;
class IndexOutOfBounds(Exception):
pass
class NotFound(Exception):
pass
class Empty(Exception):
pass
class ArrayList:
def insert(self, value, index):
if self.__capacity == self.__size:
self.__size * self.__capacity
return ArrayList.insert(self,value,index)
elif self.__capacity >= self.__size:
count = 1
while index >= count:
if count != index:
self.__arr[self.__size+1-count] = self.__arr[self.__size-count]
count += 1