Notice
Recent Posts
Recent Comments
Link
목록pop (1)
초보 개발자
파이썬 스택 Stack 간단구현!
class Node: def __init__(self, data): self.data = data self.next = None class Stack: def __init__(self): self.head = None def push(self, value): new = Node(value) new.next = self.head self.head = new # pop 기능 구현 def pop(self): if self.is_empty(): print('array is empty') return deleted = self.head self.head = self.head.next return deleted.data def peek(self): if self.is_empty(): print('array is e..
AI 웹개발 트랙 - 내배캠/4주차
2022. 1. 7. 18:53