PIXNET Logo登入

Deja Vu

跳到主文

C'est la vie

部落格全站分類:心情日記

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 4月 08 週三 200917:48
  • 數獨

sudo1.jpg
/*
 Sudo Game 4*4
*/
#include<iostream>
#include<iomanip>
#include<ctype.h>
(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(153)

  • 個人分類:神奇C++
▲top
  • 4月 07 週二 200922:27
  • HeapSort

heap.jpg
#include<iostream>
#include<iomanip>
#include<stdlib.h>
#include<time.h>
using namespace std;
(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(273)

  • 個人分類:資料結構真好玩
▲top
  • 4月 07 週二 200920:22
  • Love Story

來聽首歌吧
本來上youtube想說聽點歌
結果 "This video is not available in your country.
"
(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(42)

  • 個人分類:就是愛音樂
▲top
  • 4月 07 週二 200919:57
  • InsertionSort

666.jpg
#include<iostream>
#include<time.h>
#include<iomanip>
#include<stdlib.h>
using namespace std;
#define size 10
#define start 0
void Swap(int &a,int &b)
{
    int buf;
    buf = a;
    a = b;
    b = buf;
}
void InsertionSort(int *array)
{
    for(int i = start+1;i<size;i++)
    {
        int j = i;
        while( j>0 && array[j]<array[j-1] )
        {
            Swap( array[j] , array[j-1] );
            j--;
        }       
    }
   
}
int main()
{
    srand(time(0));
    int *array = new int[size];
    int time1,time2;
   
    cout<<"Oringinal List: ";
    for(int i = start;i<size;i++)
    {
        array[i] = rand()%20+1;
        cout<<setiosflags(ios::right)<<setw(5)<<array[i];
    }
    cout<<endl<<endl;
   
    time1 = time(0);
    InsertionSort(array);
    time2 = time(0);
   
    cout<<"After List:     ";
    for(int j = start;j<size;j++)
    {
        cout<<setiosflags(ios::right)<<setw(5)<<array[j];
    }
    cout<<endl<<endl;
    cout<<"Time: "<<time2-time1<<" Seconds"<<endl<<endl;
   
    return 0;
}
(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(79)

  • 個人分類:資料結構真好玩
▲top
  • 4月 07 週二 200919:50
  • SelectionSort

555.jpg
#include<iostream>
#include<time.h>
#include<iomanip>
#include<stdlib.h>
using namespace std;
#define size 10
#define start 0
void Swap(int &a,int &b)
{
    int buf;
    buf = a;
    a = b;
    b = buf;
}
void SelectionSort(int *array)
{
    int min;
    for(int i = start;i<size;i++)
    {
        min = i;
        for(int j = i+1;j<size;j++)
        {
            if( array[j] < array[min] )
                min = j;
        }
        Swap(array[i],array[min]);           
    }
   
}
int main()
{
    srand(time(0));
    int *array = new int[size];
    int time1,time2;
   
    cout<<"Oringinal List: ";
    for(int i = start;i<size;i++)
    {
        array[i] = rand()%20+1;
        cout<<setiosflags(ios::right)<<setw(5)<<array[i];
    }
    cout<<endl<<endl;
   
    time1 = time(0);
    SelectionSort(array);
    time2 = time(0);
   
    cout<<"After List:     ";
    for(int j = start;j<size;j++)
    {
        cout<<setiosflags(ios::right)<<setw(5)<<array[j];
    }
    cout<<endl<<endl;
    cout<<"Time: "<<time2-time1<<" Seconds"<<endl<<endl;
   
    return 0;
}
(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(35)

  • 個人分類:資料結構真好玩
▲top
  • 4月 07 週二 200919:28
  • gdb[轉貼]

雞仔用慣了Visual C++現在用gdb除錯還真不習慣 XD
但凡事總要有第一次嘛
慢慢適應囉
 
(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(175)

  • 個人分類:烏邦託的世界
▲top
  • 4月 07 週二 200918:38
  • eclipse

Large_Eclipse_Logo.jpg
非常方便的一套IDE (尤其是java)

來安裝吧!!


(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(292)

  • 個人分類:烏邦託的世界
▲top
  • 4月 07 週二 200918:19
  • BubbleSort

bubble.jpg
#include<iostream>
#include<stdlib.h>    //Ubuntu中的亂數需具此HeadFile
#include<time.h>
#include<iomanip>
using namespace std;
#define size 10
#define start 0
void Swap(int &a,int &b)
{
    int buf;
    buf = a;
    a = b;
    b = buf;
}
void BubbleSort(int array[])
{
    for(int i = size-1;i>start;i--)
    {
        for(int j = start;j<i;j++)
        {
            if( array[j] > array[j+1] )
                Swap(array[j],array[j+1]);
        }
    }
}
int main()
{
    srand(time(0));
    int *array = new int[size];
    cout<<"Oringinal List: ";   
    for(int i=start;i<size;i++)
    {
        array[i] = i;
        array[i] = rand()%20+1;    //1~20
        cout<<setiosflags(ios::right)<<setw(5)<<array[i];
    }   
    cout<<endl<<endl;
    BubbleSort(array);
   
    cout<<"After List:     ";
    for(int j=start;j<size;j++)
    {
        cout<<setiosflags(ios::right)<<setw(5)<<array[j];
    }
    cout<<endl<<endl;
    return 0;
}
(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(31)

  • 個人分類:資料結構真好玩
▲top
  • 4月 07 週二 200917:42
  • BinarySearch

bin.jpg
/*
    Binary Search
*/
#include<iostream>
using namespace std;
#define size 10
#define start 0
bool BinarySearch(int array[],int num)
{
    int p = start,r = size,middle;
   
    while(p<r)
    {
        middle = (p+r)/2;
        if( array[middle] == num )
            return true;
        else
        {
            if( array[middle] > num )
            {
                r = middle-1;
            }
            else
            {
                p = middle+1;
            }
        }
    }
   
    return false;
}
int main()
{
    int num,array[size];
   
    cout<<"The number list: ";   
    for(int i=start;i<sizeof(array)/4;i++)
    {
        array[i] = i;
        cout<<array[i]<<" ";
    }
    cout<<endl<<endl;
    cout<<"input number:";
    cin>>num;
    if( BinarySearch(array,num) == true )
    {
        cout<<"Find the number in the list: "<<num<<endl;
    }   
   
    return 0;
}
(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(58)

  • 個人分類:資料結構真好玩
▲top
  • 4月 07 週二 200917:09
  • 編譯C++

123
安裝: sudo apt-get install g++


(繼續閱讀...)
文章標籤

flyinsky76 發表在 痞客邦 留言(0) 人氣(20)

  • 個人分類:烏邦託的世界
▲top
«1...891027»

白花油盃樂樂球賽

愛的持久賽

2010痞客邦生日慶

大學生了沒-要你的大絕招

大學生了沒-要你的大絕招

LUCKY GO!貼紙

熱門文章

  • (1,588)97中央資管資結證明
  • (61)開放雲端宣言
  • (42,302)表情文字符號(轉貼)
  • (5,843)深海尋寶2

文章分類

  • 享受生活 (13)
  • 我愛看漫畫書 (2)
  • 大家一起WII (1)
  • XML (3)
  • 有恐龍的OS (1)
  • 科技新新聞 (6)
  • 演算法耶 (5)
  • 資訊要安全 (1)
  • 公仔世界 (12)
  • 樂高一樣的物件導向 (5)
  • UML愛畫圖 (12)
  • 國文小老師 (8)
  • 就是愛音樂 (16)
  • 專案管理經理 (2)
  • JSP好會動 (3)
  • 烏邦託的世界 (13)
  • 金錢滾滾來 (10)
  • 軟體也是工程 (1)
  • 神奇C++ (21)
  • 好圖分享 (11)
  • 網路無限大 (6)
  • 網頁愛漂亮 (5)
  • 駭客好厲害 (1)
  • 認識計算機 (7)
  • 資料庫真酷 (4)
  • 資料結構真好玩 (19)
  • 好書值得一讀在讀 (5)
  • 電影亂評論 (19)
  • 快樂學日文 (4)
  • 快樂學英文 (6)
  • 欣賞Ruby寶石 (9)
  • 喝JAVA咖啡 (16)
  • 未分類文章 (1)

最新文章

  • 痞客邦 T-shirt讀心術 - 一件衣服找到 SOUL MATE
  • 久石讓
  • Google PageRank
  • Danziamo
  • 朱學恆 創意與熱情
  • 大野狼 VS 小豬
  • mysql 中文顯示問題
  • 機車 VS 汽車
  • Atomic Kitten Eternal Flame
  • changeling(陌生的孩子)

誰來我家

GoogleSearch

站内Search

參觀人氣

  • 本日人氣:
  • 累積人氣:

Google廣告

杭州旅遊圓夢徵文活動

中小網大蜂學習

NBA