- char
- visited
- location (int row, col)
- 2d array of Squares
| def factorial(n): | |
| """ | |
| Int -> Int | |
| Compute the factorial of n | |
| """ | |
| result = 1 | |
| for i in range(1, n + 1): | |
| result = result * i |
| import java.util.List; | |
| public class Graph { | |
| public void addNode(String src) { | |
| } | |
| public void addEdge(String src, String dst) { | |
| } |
| import java.util.LinkedList; | |
| import java.util.List; | |
| public class HashTable<V> { | |
| private int capacity; | |
| private List<V>[] buckets; | |
| public HashTable(int capacity) { | |
| this.capacity = capacity; |
| public class HeapSorter { | |
| private int[] items; | |
| private int heapSize; | |
| private final int ROOT = 0; | |
| public HeapSorter(int[] items) { | |
| this.items = items; | |
| this.heapSize = 0; | |
| } |
| def display(lst): | |
| for el in lst: | |
| print(el) | |
| # display(["Hi", "Hello", "Bye"]) | |
| def display2(lst): | |
| for i in range(0, len(lst)): |
| public class SplayTree { | |
| private MyTreeNode root; | |
| public SplayTree() { | |
| this.root = null; | |
| } | |
| // convenience function for testing | |
| public Integer root() { |
| greets = ["hi", "hello", "bye"] | |
| print(greets[0].upper()) | |
| def cap_list(lst): | |
| pass # do this | |
| cap_list(greets) |
| def foo(x, y): | |
| current = x + y | |
| while (current < 100): | |
| current = current + x + y | |
| print(current) | |
| print("loop finished") | |
| foo(10, 10) |