Skip to content

Instantly share code, notes, and snippets.

@bmyerz
bmyerz / Sentinel.java
Created February 2, 2018 17:51
An incomplete implementation of a linked list with a sentinel
public SLinkedList {
// header always points to the sentinel node; header is NEVER null
ListNode header;
public SLinkedList() {
// point to a dummy ListNode that serves as the sentinel node
// its data doesn't matter
header = new ListNode(-1);
}