原创 第一、二章

1. cin原來也可以以空格間隔輸入(輸入包括string) 2.鍵盤上Ctrl+Z,可以表示文件結束符  3.文件重定向addItem <infile> outfile 4.char分爲:char(具體表現爲後面兩種之一,取決於編

原创 第七章 類

7.1定義抽象數據類型              讀寫操作,會改變輸入輸出流的內容,所以傳入時不用常引用(流對象不可被複制,所以採用引用的方式)      能在類內直接初始化的只有const static 常整型(char、int、lo

原创 第十二章 動態內存

12.1動態內存和只能指針     shared_ptr採用引用計數的方式,p = q;// q的引用計數自增1,p的引用計數自減1,當引用計數爲0的時候表明沒有對象使用它,而被釋放內存     通過make_shared<T>來分配動

原创 CM5.2部署impala中可能遇到的問題及解決方法

1.下載cm的安裝文件 2.安裝集羣,自動完成agent啓動以後 3.部署hive     3.0到Ubuntu mysql 不能遠程連接的問題  http://xzuse.iteye.com/blog/989231     3.1  

原创 Factorial Trailing Zeroes

Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time co

原创 Word Ladder

Given two words (beginWord and endWord), and a dictionary, find the length of shortest transformation sequence from b

原创 卸載 Cloudera Manager 5.1.x.和 相關軟件【官網翻譯:高可用】

http://www.aboutyun.com/thread-8992-1-1.html 重新安裝不完整如果你來到這裏,因爲你的安裝沒有完成(例如,如果它是由一個虛擬機超時中斷),和你想繼續安裝,然後重新安裝,做到以下幾點:刪除文件和目

原创 3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in

原创 1004 Trie樹

輸入 輸入的第一行爲一個正整數n,表示詞典的大小,其後n行,每一行一個單詞(不保證是英文單詞,也有可能是火星文單詞哦),單詞由不超過10個的小寫英文字母組成,可能存在相同的單詞,此時應將其視作不同的單詞。接下來的一行爲一個正整數m,

原创 Max Points on a Line

https://leetcode.com/problems/max-points-on-a-line/ Given n points on a 2D plane, find the maximum number of points t

原创 集羣常見問題及解決方法

狀況1:   此時很可能是集羣該臺host機器的cloudera-scm-agent進程掛掉了,改進程用於與Cloudera Manager進行通信   解決方案:在該臺機器上,輸入命令/etc/init.d/cloude

原创 第三章 字符串、向量和數組

頭文件中不應當包含using聲明,以防止其他文件包含的時候出現名字衝突     一般初始化時,分爲直接初始化和拷貝初始化(需要用到等於‘=’號),而初始值只有一個時,都可以,爲多個時,一般採用直接初始化(當然也可構建臨時對象)    

原创 Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example,

原创 Convert Sorted List to Binary Search Tree

Given a singly linked list where elements are sorted in ascending order, convert it to a height balanc

原创 第四章 表達式

    左值,用的是對象的身份(內存中的位置),右值,用的是對象的值     解引用生成左值,取地址生成一個右值     bool b = true;     bool c = -b;        //c爲true,因爲bool值在