原创 解碼器之特徵提取

特徵提取(fbank) 目的: 1.把每一幀波形變成一個包含聲音信息的多維向量; 2. 能夠符合或類似人耳的聽覺感知特性 3. 在一定程度上能夠增強語音信號、抑制非語音信號 fbank fbank的總體流程可以由下圖表示,去掉(DCT)

原创 深入紅黑樹插入刪除,並寫出一個自己的“set”(速度比STL快很多 )

寫一個自己想要的“set”,想實現什麼功能直接在裏面添加。STL雖然把set封裝的很好,很強大,易於擴展,但是正由於兼容性很好,封裝太多層,犧牲了很多性能。廢話不多說,先曬出我的測試結果: 測試用的是谷歌codejam的一道題,提供了一百

原创 leetcode: 834. Sum of Distances in Tree O(N)時間複雜度

An undirected, connected tree with N nodes labelled 0...N-1 and N-1 edges are given. The ith edge connects nodes edges[

原创 手動編程實現紅黑樹,並給出與set差不多的接口。

寫一個自己想要的“set”,想實現什麼功能直接在裏面添加。STL雖然把set封裝的很好,很強大,易於擴展,但是正由於兼容性很好,封裝太多層,犧牲了很多性能。下面是我的測試結果 void test(int num) { time_t r

原创 488. Zuma Game

Think about Zuma Game. You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(G), and white(W)

原创 編程實現一個LRU算法

這一題要我們設計一個LRU(最近最少使用算法),我的思路是用一個hash表加一個雙向鏈表實現,其插入,刪除,獲取節點時間複雜度均在O(1),代碼如下 class LRUCache { public: struct node { i

原创 LeetCode 765.Couples Holding Hands

/** if there are  M non-intersecting Euler Circuit,and the row's size is N,we have the answer N/2-M;* *   ****explanati

原创 O(1)時間編程實現LFU算法

比起LRU算法,LFU算法就是多了一個優先級,LRU是最近最少使用淘汰,LFU是在使用次數最少的前提下淘汰最早的那個頁面。爲此跟上次一樣,用一個 unordered_map  mkey,跟一個雙向鏈表存儲節點,不同的是我們需要加一個uno

原创 leetcode: 827. Making A Large Island

In a 2D grid of 0s and 1s, we change at most one 0 to a 1.After, what is the size of the largest island? (An island is

原创 leetcode: 834. Sum of Distances in Tree

An undirected, connected tree with N nodes labelled 0...N-1 and N-1 edges are given.The ith edge connects nodes edges[i