亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? life.h

?? 這是本人精心搜集的關于常用圖論算法的一套源碼
?? H
字號:
#include "SLList.h"
struct Cell
 { Cell( ) { row=col= 0; }   // constructors
   Cell(int x, int y) { row=x; col=y; }
   int row, col;           //grid coordinates
 };

class Hash_table 
{ public:
    Error_code insert(Cell *new_entry);
    bool retrieve(int row, int col) const;
  private:
    List<Cell *> table[hash_size];
}; 

class Life
{ public:
    Life( );
    void initialize( );
    void print( );
    void update( );
    ~Life( );
  private:
    List<Cell *> *living;
    Hash_table *is_living;
    bool retrieve(int row, int col) const;
    Error_code insert(int row, int col);
   int neighbor_count(int row, int col) const;
};

Error_code Hash_table::insert(const Record &new_entry)
/* Post:If the Hash_table is full, a code of overflow is returned. 
             If the table already contains an item with the key of 
             new_entry a code of duplicate error is returned.
             Otherwise: The Record new_entry is inserted into the           
              Hash_table and success is returned.
   Uses:Methods for classes Key,and Record. The function hash . */
{ Error_code result=success;
  int probe_count, increment, probe;  
  Key null;    

  null.make_blank( );
  probe=hash(new_entry);  probe_count = 0;   increment=1;    
  while( table[probe]!=null && table[probe]!=new_entry
       && probe_count<(hash_size+1)/2) 
    { probe_count++;
      probe=(probe+increment)%hash_size;
      increment += 2; 
   }
  if(table[probe]==null) table[probe]=new_entry;     
   else if(table[probe]==new_entry) result=duplicate_error;
           else result=overflow;                        
  return result;
}
  
void Life::update( )
/* Post: TheLife object contains the next generation of configuration.
   Uses: Theclass Hash_table and the class Life and its auxiliary functions. */
{ Life new_configuration;
  Cell *old_cell;
  for(int i=0; i<living->size( ); i++) 
   {living->retrieve(i, old_cell);     // Obtain a living cell.
    for(int row_add=-1; row_add<2; row_add++)
     for(int col_add=-1; col_add<2; col_add++)
      {int new_row=old_cell->row + row_add,
           new_col=old_cell->col+col_add;
           // new_row, new_col is now a living cell or a neighbor of a living cell,
       if(!new_configuration.retrieve(new_row, new_col))
       switch(neighbor_count(new_row, new_col)) 
         { case 3: //With neighbor_count3 , the cell becomes alive.
             new_configuration.insert(new_row, new_col); 
             break;
           case 2: //With count2 , cell keeps the same status.
             if(retrieve(new_row, new_col))
                new_configuration.insert(new_row, new_col); 
             break;
           default: break; // Otherwise, the cell is dead.
         }
      } // end_for(col_add ...
   } // end_for(i=...
   // Exchange data of current configuration with data ofnew_configuration .
  List<Cell *> *temp_list = living;
  living = new_configuration.living;
  new_configuration.living = temp_list;
  Hash_table *temp_hash = is_living;
  is_living = new_configuration.is_living;
  new_configuration.is_living = temp_hash;
}

void Life::print( )
/* Post: A central window onto theLife object is displayed.
Uses: The auxiliary functionLife::retrieve . */
{ int row, col;
  cout<< "\nThe current Life configuration is:\n" ;
  for(row=0; row<20; row++)
   { for(col=0; col<80; col++)
       if(retrieve(row, col)) cout<<'*';  else cout<<' ';
     cout<< endl;
   }
  cout<<endl;
}

Error_code Life::insert(int row, int col)
/* Pre: The cell with coordinates row and col is not in the Life configuration.
  Post: The cell has been added to the configuration. If insertion into either the
        List or theHash_table fails, an error code is returned.
  Uses: The class List, the class Hash_table, and the struct Cell */
{ Error_code outcome;
  Cell *new_cell=new_Cell(row, col);
  int index = living->size( );
  outcome=living->insert(index, new_cell);
  if(outcome==success) outcome = is_living->insert(new_cell);
  if(outcome != success)
    cout<<" Warning: new_Cell insertion failed" << endl;
  return outcome;
}

Life::Life( )
/* Post: The members of aLife object are dynamically allocated and initialized.
   Uses: Theclass Hash_table and theclass List . */
{ living = new List<Cell *>; is_living = new Hash_table; }

Life::~Life( )
/* Post: The dynamically allocated members of aLife object and allCell objects
         that they reference are deleted.
   Uses: Theclass Hash_table and theclass List . */
{ Cell *old_cell;
  for(int i=0; i<living->size( ); i++)
     { living->retrieve(i, old_cell);
       delete old_cell;
     }
  delete is_living; // Calls theHash_table destructor
  delete living; //Calls theList destructor
}
const int factor = 101;
int hash(int row, int col)
/* Post: The function returns the hashed valued between0 andhash_size . 1
         that corresponds to the givenCell parameter. */
{  int value;
   value = row + factor*col;
   value %= hash_size;
   if(value< ) return value+hash_size;
    else return value;
}
  

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区在线视频| 欧美日韩国产精选| 国产在线看一区| 日日摸夜夜添夜夜添国产精品| 亚洲一区二区三区视频在线播放| 亚洲精品日韩一| 亚洲午夜国产一区99re久久| 亚洲一区电影777| 婷婷久久综合九色综合绿巨人| 亚洲国产视频a| 美女网站色91| 国产一区二区三区蝌蚪| 成人黄色片在线观看| 不卡高清视频专区| 欧美性猛片xxxx免费看久爱| 欧美视频在线一区二区三区| 91精品国产综合久久福利| 欧美一区二区三区的| 久久久国产午夜精品| 国产精品色哟哟| 亚洲一区二区三区激情| 美女一区二区三区| 成人免费视频视频| 欧美午夜精品一区二区蜜桃| 日韩欧美国产一区在线观看| 欧美国产国产综合| 婷婷综合久久一区二区三区| 国产一区二区精品久久99| 99久久综合精品| 91精品国产综合久久福利软件 | 日韩欧美在线不卡| 国产欧美日韩精品在线| 亚洲国产毛片aaaaa无费看| 麻豆国产欧美一区二区三区| 成人丝袜18视频在线观看| 欧美性生活大片视频| 日韩欧美电影在线| 综合久久给合久久狠狠狠97色| 天天影视涩香欲综合网| 国产精品亚洲第一| 欧美一级久久久久久久大片| 国产精品亲子伦对白| 麻豆精品在线播放| 色综合久久久久综合体| 日韩一区二区免费在线观看| 成人免费在线视频观看| 奇米四色…亚洲| 91麻豆swag| 欧美激情一区二区三区四区 | 国产美女精品在线| 欧洲亚洲国产日韩| 国产欧美精品一区二区色综合朱莉| 亚洲综合精品自拍| 粉嫩一区二区三区性色av| 欧美日韩一卡二卡三卡 | 色欧美片视频在线观看| 久久日韩精品一区二区五区| 亚洲v中文字幕| 色婷婷亚洲精品| 欧美高清在线精品一区| 国产综合久久久久影院| 在线电影院国产精品| 亚洲精品大片www| av在线一区二区三区| 欧美国产禁国产网站cc| 极品少妇xxxx精品少妇| 日韩欧美一级在线播放| 亚洲成人免费av| 日本韩国一区二区三区| 国产精品久久久久久亚洲伦 | 欧美一区三区二区| 亚洲自拍都市欧美小说| 色欧美88888久久久久久影院| 国产精品午夜春色av| 高清国产一区二区三区| 久久午夜老司机| 国产一区二区三区在线观看免费视频| 制服丝袜国产精品| 免费观看30秒视频久久| 欧美一三区三区四区免费在线看| 亚洲v日本v欧美v久久精品| 在线观看亚洲a| 亚洲主播在线观看| 欧美裸体一区二区三区| 日韩1区2区3区| 日韩美一区二区三区| 国内精品在线播放| 日本一区二区视频在线| av中文字幕亚洲| 亚洲最色的网站| 欧美高清视频不卡网| 日韩电影免费在线看| 精品久久久久久久久久久久包黑料| 免费久久99精品国产| 久久久五月婷婷| 播五月开心婷婷综合| 一区av在线播放| 欧美一区二区三区思思人| 国产主播一区二区| 国产精品国产三级国产普通话蜜臀| 99精品视频一区二区| 亚洲一级不卡视频| 精品日韩成人av| av电影在线不卡| 亚洲成av人综合在线观看| 日韩免费高清av| 91网站在线播放| 日本欧美一区二区在线观看| 26uuu亚洲综合色欧美| 99国产精品99久久久久久| 香蕉av福利精品导航| 久久久影视传媒| 欧美日韩亚州综合| 国产福利一区二区| 亚洲v日本v欧美v久久精品| 久久综合狠狠综合久久激情| 91一区在线观看| 久久99久久99精品免视看婷婷 | 欧美一级搡bbbb搡bbbb| 国产精华液一区二区三区| 一区二区三区四区国产精品| 日韩美女在线视频| 日本电影亚洲天堂一区| 国产露脸91国语对白| 亚洲成av人影院| 亚洲免费看黄网站| 久久精品男人的天堂| 欧美高清一级片在线| 97久久人人超碰| 国产一区二区免费视频| 午夜久久福利影院| 亚洲色图清纯唯美| 欧美国产成人在线| 久久综合国产精品| 日韩一区二区视频| 欧美视频一区二| 91视频xxxx| 丁香婷婷综合激情五月色| 另类欧美日韩国产在线| 丝袜美腿亚洲综合| 亚洲成人自拍偷拍| 亚洲一区二区三区在线播放| 亚洲视频一区二区在线观看| 久久蜜桃香蕉精品一区二区三区| 欧美精品自拍偷拍动漫精品| 色菇凉天天综合网| 91在线观看地址| 91在线云播放| 91在线高清观看| 91猫先生在线| 91丨porny丨蝌蚪视频| 成人av在线资源网| 国产99久久久久久免费看农村| 精东粉嫩av免费一区二区三区| 日韩精品久久理论片| 日韩高清在线观看| 日韩电影在线观看电影| 蜜桃在线一区二区三区| 美女久久久精品| 麻豆精品国产传媒mv男同| 久久精品国产亚洲aⅴ| 黄色小说综合网站| 国产成人精品影院| 成人的网站免费观看| 99久久免费视频.com| 99九九99九九九视频精品| 91麻豆精东视频| 欧洲在线/亚洲| 在线成人免费观看| 日韩欧美激情一区| 国产精品乱人伦一区二区| 国产精品传媒在线| 亚洲国产日韩a在线播放| 天堂va蜜桃一区二区三区 | 中文字幕 久热精品 视频在线 | 亚洲欧洲制服丝袜| 亚洲一区二区成人在线观看| 日韩**一区毛片| 国产成人综合在线| 在线亚洲精品福利网址导航| 日韩视频免费观看高清在线视频| 2017欧美狠狠色| 亚洲欧洲www| 免费观看日韩av| 成人黄色av网站在线| 欧美日韩在线播| 亚洲精品一区二区三区四区高清| 亚洲国产精品传媒在线观看| 夜夜嗨av一区二区三区中文字幕| 日本美女视频一区二区| 成人不卡免费av| 欧美高清激情brazzers| 国产精品久久久久久久裸模| 亚洲国产欧美在线人成| 风流少妇一区二区| 7777精品伊人久久久大香线蕉 | 亚洲一区二区三区精品在线| 激情成人综合网| 欧美色图在线观看| 日本一区二区三区国色天香 |