全排列問題描述為:給定一串?dāng)?shù)字,生成所有可能的排列。本文給出兩類,一種使用C++通過回溯算法,一種使用Scala通過遞歸來求解。 首先介紹使用S...
下面給出一個Scala中while循環(huán)的例子: 雖然在實際中不建議這么來寫。while在Scala中是一個關(guān)鍵字,但是我們可不可以用一個函數(shù)來定...
Use the priority queue to implement Huffman Tree, written in C++ and use...
Trie樹的解釋參見:http://blog.csdn.net/hguisu/article/details/8131559 下面是用C實現(xiàn)的代...
Monads 帶有map和flatMap方法的數(shù)據(jù)結(jié)構(gòu)很常見。實際上,there’s a name that describes this cl...
Case Class 當(dāng)要定義復(fù)雜的數(shù)據(jù)類型時,可以使用Case classes。如下面所示,定義一個JSON數(shù)據(jù)表示: 通過Scala的cas...
All code can be find here. Implementing Recurrent Neural Network from Sc...
All code can be find here. Implementing Multiple Layer Neural Network fr...