原创 Redis教程:主從複製

目錄 1 主從配置方法 2 主從複製的作用 3 主從複製的機制 3.1 全量數據同步(full resyncchrozation) 3.2 增量同步 4 主從複製的實現 4.1 主從關係的建立 1 主從配置方法 配置文件: 在從服務器的配

原创 Redis教程:數據持久化

目錄 1 RDB持久化 1.1 RDB文件的創建和載入 1.2 自動間隔性保存 1.3 RDB文件結構 2 AOF持久化 2.1 AOF持久化的實現 2.2 AOF文件的載入與數據還原 1 RDB持久化        Redis提供了RD

原创 Redis教程:數據對象分析(二)

目錄 1 類型檢查與命令多態 2 內存回收 3 對象共享 4 對象的時轉時長 1 類型檢查與命令多態        Redis中用於操作鍵的命令基本上可以分爲兩種類型:其中一種命令可以對任何類型的鍵執行,比如DEL命令、EXPIRE命令、

原创 Redis教程:數據對象分析

1、 五種基本數據對象 圖1 redis數據對象 2、 數據結構對象分析       Redis中的每個對象都由一個redisObject結構表示,該結構中保存數據相關的三個屬性分別是:type、encoding、ptr。 redis.

原创 76. Minimum Window Substring

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity

原创 49. Group Anagrams

Given an array of strings, group anagrams together. Example: Input: ["eat", "tea", "tan", "ate", "nat", "bat"], Output

原创 312. Burst Balloons

Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are

原创 207. Course Schedule

There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for exampl

原创 146. LRU Cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: 

原创 【壓縮原理】 deflate 算法

目錄   1 概述 2 LZ77算法原理 2.1 壓縮 2.2 解壓縮 3 Huffman編碼 3.1 構造霍夫曼樹 4 參考 1 概述        DEFLATE是同時使用了LZ77算法與哈夫曼編碼(Huffman Coding)的一

原创 347. Top K Frequent Elements

Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k =

原创 84. Largest Rectangle in Histogram

Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area o

原创 32. Longest Valid Parentheses

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parenthes

原创 337. House Robber III

The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "ro

原创 nginx: 編寫簡單handler模塊

1、ubuntu安裝nginx服務 (1)安裝依賴庫: 安裝gcc g++的依賴庫 apt-get install build-essential apt-get install libtool 安裝pcre依賴庫 sudo apt-