Skip to content

Instantly share code, notes, and snippets.

View SylvanasSun's full-sized avatar

SylvanasSun SylvanasSun

  • Tianjin,China
View GitHub Profile
@SylvanasSun
SylvanasSun / RedBlackTree.java
Last active October 14, 2018 11:07
This class represent red black tree.
import java.util.*;
/**
* The {@code RedBlackTree} class represents an ordered symbol table of generic
* key-value pairs.
* This implements uses a left-leaning red-black Binary Search Tree.
*
* Created by SylvanasSun on 2017/6/1.
*
* @author SylvanasSun
@SylvanasSun
SylvanasSun / PackageScanner.java
Created October 14, 2017 12:15
Package Scanner
/**
* Interface PackageScanner is the basic interface for package scanning.
*
* Created by SylvanasSun on 10/13/2017.
*/
public interface PackageScanner {
/**
* Scanning specified package then return a class list of the after the scan.
*/
@SylvanasSun
SylvanasSun / simhash.py
Created January 30, 2018 10:57
In computer science, SimHash is a technique for quickly estimating how similar two sets are. The algorithm is used by the Google Crawler to find near duplicate pages. It was created by Moses Charikar.
# Created by SylvanasSun in 2017.10.17
# !/usr/bin/python
# -*- coding: utf-8 -*-
import collections
import jieba
from jieba import analyse
# TODO: Change default hash algorithms to the other algorithms of high-performance.
@SylvanasSun
SylvanasSun / LinearProbingHashST.java
Created April 14, 2017 09:12
This hash table implements uses a separate chaining and linear probing.
import java.util.*;
/**
* The {@code LinearProbingHashST} class represents a symbol table of generic
* key-value paris.
* This implementation uses a linear probing hash table.
* It requires that the key type overrides the {@code equals()} and {@code hashCode()} methods.
* <p>
* Created by SylvanasSun on 2017/4/11.
*/
@SylvanasSun
SylvanasSun / SkipList.java
Last active March 25, 2024 03:00
A simple implementation of the Skip List.
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Random;
/**
* A skip list is a data structure that allows fast search within
* an ordered sequence of elements. Fast search is made possible
* by maintaining a linked hierarchy of subsequences, with each
* successive subsequence skipping over fewer elements than the
* previous one. Searching starts in the sparsest subsequence until