Skip to content

Instantly share code, notes, and snippets.

View yangtianrui95's full-sized avatar
🎯
Focusing

yang tianrui yangtianrui95

🎯
Focusing
View GitHub Profile
@yangtianrui95
yangtianrui95 / SimpleHeap.java
Last active July 13, 2019 15:04
A simple heap implemented in Java.
import java.util.Arrays;
/**
* 大顶堆实现
*/
public class SimpleHeap {
public static void main(String[] args) {
SimpleHeap heap = new SimpleHeap(10);
heap.put(1);
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* 2-3树实现/仅供学习使用
*
* @author yangtianrui
*/
public class TwoThreeTree {
/**
* 红黑树基础实现/递归版本/仅做学习用
*
* @author yangtianrui
*/
public class RBTree {
private static final boolean RED = true;
private static final boolean BLACK = false;