原创 簡單的Trie前綴樹實現

import java.util.LinkedList; import java.util.List; class TrieNode { List<TrieNode> children = new LinkedList<

原创 Skip List基本操作

public class SkipList { public int height; public int size; public Random random = new Random(); p

原创 二叉搜索樹查找第K小的元素

import java.util.ArrayList; import java.util.LinkedList; import java.util.List; class TreeNode { int val;

原创 簡單的LRU Cache實現

class LRUCache { public static class Node { public int key; public int value; public No

原创 簡單的HashMap實現

/** * 借鑑自HashMap源碼 */ class MyHashMap { private int sizeOfTable = 1024; private Node[] table = new Node[

原创 矩陣從左上角到右下角的最小路徑值

public class Temp { public static int minPathNum(int[][] data, int startI, int startJ, int endI, int endJ) {

原创 約瑟夫環報數出列問題

public class Temp { public static void printYuesefuNum(int total, int k) { int[] data = new int[total]

原创 簡單的LFU Cache實現

import java.util.HashMap; import java.util.Map; import java.util.TreeMap; class LFUCache { static class Node {

原创 二叉樹求兩個節點最近公共祖先

class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; }

原创 數組右移後二分查找

import java.util.Arrays; public class Temp { //右移數組m位 public static void shiftArray1(int[] data, int m) {

原创 elasticsearch v5.x 常用http接口

可以使用 postman http交互工具操作集羣 http://127.0.0.1:9200/_cluster/state http://127.0.0.1:9200/_cluster/health http://127.0

原创 Intellij Idea 運行Elasticsearch源碼 v6.0.0

一、環境 OS:windows 10 IntelliJ IDEA 2018.2.1 (Ultimate Edition) elasticsearch 源碼:git clone https://github.com/elastic/

原创 二叉樹序列化和反序列化

import java.util.Arrays; import java.util.Iterator; import java.util.LinkedList; import java.util.List; class Tree

原创 整數數組能組成的最大數字

public class Temp { public static String largestNumber(int[] nums) { String[] numStrArray = new String

原创 數組中尋找峯值

public class Solution { //只存在一個峯值 public static Integer findMaxNum(int[] nums) { if (nums == null ||