Skip to content

Instantly share code, notes, and snippets.

View MathewDavidov's full-sized avatar

Mathew Davidov MathewDavidov

View GitHub Profile
@MathewDavidov
MathewDavidov / MyHashMap.java
Created May 4, 2019 16:33
Hash Map implementation with Generics
import java.util.*;
public class MyHashMap<K, V> implements Map<K, V>{
private static class Pair<K, V> implements Map.Entry<K, V> {
private final K key;
private V value;
public Pair(K key, V value) {
this.key = key;
this.value = value;
@MathewDavidov
MathewDavidov / LinkedListSent.java
Created May 2, 2019 04:26
Doubly Linked List with Sentinel
import java.lang.reflect.Array;
import java.util.*;
public class LinkedListSent<E> implements List<E>, Deque<E>, Iterable<E> {
private static class Node<E> {
private E data;
private Node<E> next;
private Node<E> previous;
public Node(E data, Node<E> next, Node<E> previous) {