bool mystrcmp(const char *a, const char *b) { while (*a == *b) { if (*a++ == '\0') return true; b++; } return *a == *b; }
5 月
04
2012
04
2012
string compare strcmp implementation
1 月
02
2012
02
2012
LZW compression & decompression pseudocode
期末考記錄用
參考自此但我覺得需要修改
LZW compression
string = NULL; while character = next input character{ if string+character is in table { string = string + character } else { output code of string add string+character to table string = character } }
LZW decompression
while code = next input code { if code is new code { string = translated code output string // string(0) is the first character of string add prevString+string(0) to table } else { add to table for known code sequence string = translated code output string } prevString = string }