8월, 2012의 게시물 표시

[C++ STL] heap

1. max heap // range heap example #include <iostream> #include <algorithm> #include <vector> using namespace std; int main () { int myints[] = {10,20,30,5,15};   vector<int> v(myints,myints+5);   make_heap (v.begin(),v.end());   cout << "initial max heap : " << v.front() << endl;   pop_heap (v.begin(),v.end()); v.pop_back();   cout << "max heap after pop : " << v.front() << endl;   v.push_back(99); push_heap (v.begin(),v.end());   cout << "max heap after push: " << v.front() << endl;   sort_heap (v.begin(),v.end());   cout << "final sorted range :"; for (unsigned i=0; i<v.size(); i++) cout << " " << v[i];   cout << endl; return 0; } Output: initial max heap   : 30 max heap after pop : 20 max heap after push: 99 final sorted range : 5 10 15 20 99 2. min heap #include <functional...

잡다한 정보들

eclipse가 잘 되다가 안될 때 http://blog.naver.com/youmitu?Redirect=Log&logNo=6013355360 효과적인 구글검색방법 http://boribab.tistory.com/3297 http://killereco.tistory.com/28 입력버퍼 비우는 법 http://plustag.tistory.com/1 난 scanf는 자동으로 버퍼 비워주는 줄 알았는데.. 지금까지 잘못알았다. 늘어가는 삽질 fflush함수는 gcc표준으로는 출력버퍼를 비우는 것 http://blog.naver.com/PostView.nhn?blogId=chamsol79&logNo=140010284718&parentCategoryNo=6&viewDate=&currentPage=1&listtype=0 깨알같은 윈도우 단축키 http://youni.biz/technote01/board.php?board=tag&command=body&no=348&PHPSESSID=a6c769576dac3dc12ca7d8af0c9768dc 인터넷 익스플로러 사용할 때 딸깍 거리는 소리, 이어폰 끼면 거슬리는데 없애는 법 http://blog.naver.com/dalsapcho?Redirect=Log&logNo=20133956172 MIPS instruction 정리 http://blog.naver.com/kain_hoon?Redirect=Log&logNo=140012329014 li move http://en.wikibooks.org/wiki/MIPS_Assembly/Pseudoinstructions MIPS wiki http://en.wikipedia.org/wiki/MIPS_architecture c++ Reference http://www.cplusplus.com/reference/ mysql 권한 설정 ( http:...