Time of Update: 2018-12-04
/*extendible_hashing.c -- 可擴散列實現檔案*/#include <stdio.h>#include <stdlib.h>#include "extendible_hashing.h"/*局部函式宣告*/static char pow_base_two (const int power) ;/*介面函數定義*/int Hash (const Item * const pitem, const char constant){return
Time of Update: 2018-12-04
/*binary_heap.c -- 二元堆積實現檔案*/#include <stdio.h>#include <stdlib.h>#include "binary_heap.h"/*局部函式宣告*//*返回 item 在 position 位置處上濾後應該出現堆中的位置索引*/static int Percolate_Up (const Heap * const pheap, const Item item, const int position) ;/*返回
Time of Update: 2018-12-04
排序的穩定性,是指排序前後,相同元素的位置先後關係是否改變.穩定排序,是位置先後關係不變.不穩定排序,是先後位置關係改變,當然,也存在不改變的可能.更說明了他的不穩定.可笑吧?哈哈... <<AtA>>的一道課後習題,問了幾種常見排序的穩定性問題,以及如何將不穩定排序改為穩定排序.為了探尋這個問題,我決定動手寫出這些排序.這是昨天的事,昨天開始寫的.到現在寫完了,中途幹了許多別的事情. 還是第一次,默寫這些個排序.收穫很多,可以說,最起碼克服了默寫這些排序的恐懼.
Time of Update: 2018-12-04
/*binary_heap.c -- 二元堆積實現檔案*/#include <stdio.h>#include <stdlib.h>#include "binary_heap.h"/*局部函式宣告*/static int Percolate_Up (const Binary_Heap * const pbh, const int index) ;static int Percolate_Down (const Binary_Heap * const pbh, const
Time of Update: 2018-12-04
/*9-18(b)-12-19-00.49.c -- 第九章第十八題*/#include <stdio.h>#include <stdlib.h>#include "binary_heap_for_kruskal.h"#include "disjiont_set.h"#define SIZE (10)int main (void) ;void kruskal (const Adjacenty_List * const padj, const Hash_Table *
Time of Update: 2018-12-04
//13-1.cpp#include "stdafx.h"#include "13-1.h"namespace binarySearchTree{//private:Node * BinarySearchTree :: m_MakeNode (const Item & item){Node * newNode = new Node ;if (newNode){newNode -> item = item ;newNode -> left = newNode ->
Time of Update: 2018-12-04
用了類模板,不知是不是多此一舉,反正練習為主.//graphRepresentAsAdjacentMatrix.h --graph header file.//Purpose://A graph represent as a adjacent matrix, this graph can't storage //weight value instead of true or false means m_matrix[i][j] is on or off.#ifndef
Time of Update: 2018-12-04
using System;using System.Collections;public class List{ public bool onOff = false; public static IEnumerable ForExample() { yield return "1"; // 第一次調用時執行 yield return "2"; // 第二次調用時執行 if (onOff) //
Time of Update: 2018-12-04
用c訪問COM對象 雖然c++一般用於COM程式中,但是你也可以使用C語言來訪問COM對象。這樣做比較直截了當,但是需要更複雜的文法。 ●所有的方法都需要添加一個附加的參數添加到參數列表的開始位置。這個參數必須被設定程介面指標。 ●你必須顯示的引用對象的這個值。
Time of Update: 2018-12-04
本文作者:Closeall本文出處:http://blog.csdn.net/closeall2008聲明: 本文可以不經作者同意, 任意複製, 轉載, 但任何對本文的引用都請保留文章的作者, 出處以及聲明資訊. 謝謝. 去年晚些時候,寫過一個簡單的網路更新程式。用戶端的程式介面要想用VC把它做漂亮些,確實有些繁瑣。這些天想把它改寫一下,就是用C 把用戶端的通訊模組做成一個dll,然後其它的編程環境來做介面,通訊的時候,讓其調用用c寫的那個dll即可。但這裡涉及到了一些小問題—
Time of Update: 2018-12-04
#include <iostream>//虛解構函式是在衍生類別轉換成為基類時出現。//衍生類別預設可以轉換成為基類using namespace std;class A{ public: virtual~A(){ cout<<"~A()"<<endl;}};class B:public A{ public: ~B(){ cout<<"~B()"<<endl;}};int main(){ B cb; A
Time of Update: 2018-12-04
C# WinForm下實現的發送郵件案例下載 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Net;using System.Net.Sockets;namespace SendMail{
Time of Update: 2018-12-04
本文轉自冷秋魂的blog.函數名: stpcpy 功 能: 拷貝一個字串到另一個 用 法: char *stpcpy(char *destin, char *source); 程式例: #include <stdio.h> #include <string.h> int main(void) { char string[10]; char *str1 = "abcdefghi"; stpcpy(string, str1); printf("%
Time of Update: 2018-12-04
4.記憶體管理機制--記憶體對應檔 (Map)
Time of Update: 2018-12-04
什麼都不說了,先貼代碼吧,在VS2010裡面輸入以下代碼(MAC Book沒電了(電源不想找,不能在MAC OS XCode裡面測試了))//A.c fileintiValue;//B.c fileintiValue;//main.c file#include <stdio.h>extern intiValue;int main(){ printf("%d\n", iValue);} C語言有如下標準:
Time of Update: 2018-12-04
C# CHM協助文檔產生工具-Sandcastle 為了讓我們的Team Dev規範文檔,並易於交流,最終使用了Sandcastle產生chm格式文檔。 一、下載。我發現有兩種Sandcastle可供下載,一個是官方的Sandcastle,另一個是SandcastleGUI(圖形介面的)。前一個是必須安裝的,然後再下載個SandcastleGUI,直接使用即可,為:Sandcastle:
Time of Update: 2018-12-04
如果說前面我們已經把武功練到了第十重境界的話,最後一章意味著我們馬上要開啟任督二脈,一夜飛升了:)基於這樣的關鍵的時間點,我們願意非常謹慎的把這個問題分三次慢慢的講,講清楚。這第一次我們將說到這個MultiMethod話題的開始和第一個解決方案。這個MultiMethod的問題源自於C++不支援多參數的函數多態,(其實原先我不覺得我們有這麼多這樣類型的需求,但是當看到不知道起什麼名字的時候我相信了)而且恰好這裡的需求和Alex的Sample驚人的類似。這裡我們不再對問題本身做過多的描述,而是直奔
Time of Update: 2018-12-04
緊接這上次沒說完的來說。上回我們介紹了最基本的brute-force方案。那個安全的類型遍曆匹配方案。說到在類數量比較多的時候不一定高效。很簡單的可以知道原來的時間複雜度是O(n),n就是類的數量。所以估摸這轉化成O(log(n))應該差不多了。所以這個第二方案就是用關聯性的容器來替代依次遍曆。我們把這個方案稱之為The Logarithmic Double Dispatcher. 就像Scotter Mayer在《More Effective
Time of Update: 2018-12-04
在粗粗地說了Function Templates之後,肯定要說說最主要的的Class Templates。因為是開始,所以肯定要說的明白點,清楚點:#include <vector>#include <stdexcept>template <typename T>class Stack { private: std::vector<T> elems; // elements public: void push(T
Time of Update: 2018-12-04
眾所周知當使用一個容器的insert或者erase函數通過迭代器插入或刪除元素"可能"會導致迭代器失效,因此很多建議都是讓我們擷取insert或者erase返回的迭代器,以便用重新擷取新的有效迭代器進行正確的操作:view plaincopy to clipboardprint?iter=vec.insert(iter); iter=vec.erase(iter);