This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some common sorting algorithm snippet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Comparator; | |
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
import java.util.Scanner; | |
/** | |
* max heap priority queue | |
* | |
* @author SylvanasSun | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package chapter3_searching.C3_2_BinarySearchTrees; | |
import edu.princeton.cs.algs4.Queue; | |
import java.util.NoSuchElementException; | |
import java.util.Scanner; | |
/** | |
* The {@code BinarySearchTree} class represents an ordered symbol table of generic | |
* key-value pairs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import edu.princeton.cs.algs4.Queue; | |
import java.util.NoSuchElementException; | |
import java.util.Scanner; | |
/** | |
* The {@code RedBlackBST} class represents an ordered symbol table of generic | |
* key-value pairs. | |
* This implements uses a left-leaning red-black Binary Search Tree. | |
* It requires that the key type implements the {@code Comparable} interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package chapter3_searching.C3_3_BalancedSearchTrees; | |
import edu.princeton.cs.algs4.Queue; | |
import java.util.NoSuchElementException; | |
import java.util.Scanner; | |
/** | |
* The {@code AvlTree} class represents an ordered symbol table of generic | |
* key-value pairs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.concurrent.atomic.AtomicReference; | |
/** | |
* This class represents a thread-safe stack and use CAS instruction to ensure thread safe. | |
* | |
* Created by SylvanasSun on 2017/5/29. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd"> | |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | |
<!-- 输出日志到控制台 ConsoleAppender --> | |
<appender name="console" | |
class="org.apache.log4j.ConsoleAppender"> | |
<param name="encoding" value="UTF-8"/> | |
<layout class="org.apache.log4j.TTCCLayout"> | |
<param name="ConversionPattern" value="TTCCLayout"/> |
OlderNewer