原创 第4章 更多的 bash shell命令 - df、du、sort、grep、zip、tar等

Linux 系統將所有的磁盤都掛載到一個虛擬目錄下。 在使用新的存儲媒體之前,你需要把他們放到虛擬目錄下。這項工作成爲掛載(mounting)。 在Linux系統上移除一個可移動設備時,不能直接從系統上刪除,而應該先卸載它。 d

原创 233 - Number of Digit One

Number of Digit One  Total Accepted: 307 Total Submissions: 1853 Given an integer n, count the total number of

原创 2-11章 筆記

註釋不能嵌套,// 形式的不能跨行。 C語言歷史:Old Style C、 C89(ANSI C)、 C99(ISO/IEC9899:1999) main函數的特殊之處,在於執行程序時它自動被操作系統帶哦用,操作系統就認準了m

原创 203 - Remove Linked List Elements

題目: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4

原创 241-Different Ways to Add Parentheses

Given a string of numbers and operators, return all possible results from computing all the different possible ways to

原创 爲 vector 重載

代碼如下: #include <iostream> #include <vector> using namespace std; ostream& operator<< (ostream& out, vector<string>& _

原创 thrift -java

book.thrift namespace java example struct Book_Info { 1: i32 book_id, 2: string book_name, 3: string book_auth

原创 爲自定義的類寫

#include <iostream> using namespace std; class item; ostream & operator <<(ostream & os, item& _item); class item {

原创 低級IO - read

不需要標準庫的 scanf 等函數,而是直接調用 unix 系統低級IO函數 read。 實現:將任意輸入複製到任意輸出。 代碼如下: int main() { char buf[5]; int

原创 什麼是程序?

編程語言分爲低級語言和高級語言; 機器語言和彙編語言屬於低級語言,直接用計算機指令編寫程序。而 C、C++、Java、Python等屬於高級語言,用語句編寫程序,語句是計算機指令的抽象表示。 c 語言 : a = b + 1;

原创 C++ 類初探

感悟: C++:無非是C 的語法特性 與 C++的類語法相結合,支持面向對象和麪向過程的混合。 當然,C++的 STL 庫,以及包括容器等內容,是擴充的,需要慢慢來熟悉。 代碼: #include<iostream> #include<

原创 x86 彙編程序基礎

最簡單的彙編程序: 這個程序只做了一件事情:退出,退出狀態是 4 鏈接(linking):就是將不同部分的代碼和數據收集和組合成爲一個單一文件的過程,這個文件可被加載(或拷貝)到存儲器並執行。鏈接可以執行於編譯(compile t

原创 242-Valid Anagram

Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nag

原创 237 - Delete Node in a Linked List

題目: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Sup

原创 152 - Maximum Product Subarray 錯誤記錄

Find the contiguous subarray within an array (containing at least one number) which has the largest product. For exa