原创 快速排序實現

#include <iostream> #include <vector> #include <cstdlib> using namespace std; //兩個版本 void show(vector<int> &v) { vect

原创 堆排序,優先隊列實現

//堆排序 #include <iostream> #include <vector> using namespace std; //vector<int> heap; //父親節點 int parent(int i) { if( i

原创 希爾排序

#include <iostream> #include <vector> using namespace std; void swap(int & a,int & b) { a=a+b; b=a-b; a=a-b; } void

原创 冒泡排序(正宗點吧)

#include <iostream> #include <vector> using namespace std; void swap(int & a,int & b) { a=a+b; b=a-b; a=a-b; } vec

原创 線程之路二:線程原子操作和線程CriticalSection操作

一原子操作:即是那種運行了不把這條語句執行完就不會把計算機控制權交給另一個線程控制 #include <iostream> #include<Windows.h> #include <process.h> int num=0; uns

原创 線程之路一:CreateThread()和-beginthreadex()

第一部分代碼 CreateThread(); 線程傳值線程返回pid #include <Windows.h> #include <iostream> //傳值 返回進程id DWORD WINAPI ThreadFun(LPVOID

原创 1.輸入n,打印一到n位最大數字,比如輸入3,打印1到999

面試題是我找的,代碼也看了,但是代碼我自己寫的!!! //大數相加,相減 相除 相乘 #include <iostream> using namespace std; //此轉換只是在特定條件下的 int類型只有0-9 inline

原创 選擇排序(非冒泡排序)我也不懂了 第一個算冒泡排序了嗎?

#include <iostream> #include <vector> using namespace std; void swap(int & a,int & b) { a=a+b; b=a-b; a=a-b; } vec

原创 Java異常處理詳解

1JAVA異常 異常指不期而至的各種狀況,如:文件找不到、網絡連接失敗、內存越界等。異常是一個事件,它發生在程序運行期間,干擾了正常的指令流程。Java通過API中Throwable類的衆多子類描述各種不同的異常。因而,Java異常都

原创 android 國內無法下載leakcanary

buildscript { repositories {jcenter() mavenCentral() } dependencies { classpath 'com.android.tools.bui

原创 引用、指針的指針、指針的引用

代碼不具備可用性,只是用來測試 #include <iostream> using namespace std; class myclass{ public: myclass(){}; ~myclass(){}; }; void

原创 2.倒置字符串(這裏第二個倒置出現問題不知道怎麼解決)

//倒置字符串 #include <iostream> using namespace std; //倒置原字符串 void reverse1(char * s) { if (s) { char temp; char * e

原创 3.去除字符串中重複字符,保證每個字符只出現一次

//Design an algorithm and write code to remove the duplicate characters in a string //without using any additional buf

原创 android寫京東首頁

     final GridLayoutManager gridManager = ((GridLayoutManager) manager);     gridManager.setSpanSizeLookup(new GridLay

原创 1.確定一個字符串每個字符都是獨一無二的

//Implement an algorithm to determine if a string has all unique characters What if //you can not use additional data