摘要: Implement a circular buffer of size N. Allow the caller to append, remove and list the contents of the buffer. Implement the buffer to achieve maximum performance for each of the operations.The new items are appended to the end and the order is retained i.e elements are placed in increasing order of 阅读全文
posted @ 2012-09-14 16:30 可乐爱上了雪碧 阅读(173) 评论(0) 推荐(0) 编辑
摘要: ansi to unicode 函数调用要注意。static TCHAR regPath[] = _T("Software\\snda\\IGW");static TCHAR regItem[] = _T("SNDALOGINASSISTANT");static TCHAR regValue[MAX_PATH] = {0};GetRegValue(regValue, regPath, regItem);static BOOL GetRegValue(TCHAR * regValue, const TCHAR * regPath, const TCHAR 阅读全文
posted @ 2012-09-14 16:15 可乐爱上了雪碧 阅读(332) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;//num is the number of the array,index from 0 to num-1//the index relationship : child index is k then parent index is (k-2)/2void shiftDown(int * an, int i, int num){ if(NULL == an || i < 0 || num < 0) return; int temp = an[i]; while(2*i+1 < num 阅读全文
posted @ 2012-09-14 09:31 可乐爱上了雪碧 阅读(411) 评论(0) 推荐(0) 编辑