def test_quick(): import random for i in range(0, 10000): tcount = i % 100 fcount = 100 - tcount tset = [True] * tcount + [False] * fcount random.shuffle(tset) s1 = Stack(tset) s2 = Stack(tset) assert s1.solve_regular() == s2.solve_quick()
#!/usr/bin/env python # -*- coding: utf-8 -*- from solution import Stack st = Stack() st.push(1) print(st.top()) print(st.empty()) # st.push(1) # print(st.pop())