1 生物計算期末作業 暨南大學資訊工程系 2003/05/13. 2 compare f1 f2  只比較兩個檔案 f1 與 f2 ,比完後將結果輸出。 compare directory  以兩兩比對的方式,比對一個目錄下所有檔案的相 似程度。  將相似度很高的檔案做成報表輸出,報表中至少要.

Slides:



Advertisements
Similar presentations
Divide-and-Conquer. 什麼是 divide-and-conquer ? Divide 就是把問題分割 Conquer 則是把答案結合起來.
Advertisements

布林代數的應用--- 全及項(最小項)和全或項(最大項)展開式
第七章 抽樣與抽樣分配 蒐集統計資料最常見的方式是抽查。這 牽涉到兩個問題: 抽出的樣本是否具有代表性?是否能反應出母體的特徵?
: A-Sequence 星級 : ★★☆☆☆ 題組: Online-judge.uva.es PROBLEM SET Volume CIX 題號: Problem D : A-Sequence 解題者:薛祖淵 解題日期: 2006 年 2 月 21 日 題意:一開始先輸入一個.
Section 1.2 Describing Distributions with Numbers 用數字描述分配.
3Com Switch 4500 切VLAN教學.
Reference, primitive, call by XXX 必也正名乎 誌謝 : 部份文字取於前輩 TAHO 的文章.
期末專題 - 吊人頭遊戲 第 35 組 組員 : 電機系 49841XXXX XXX 電機系 49841OOOO OOO.
OAQ 的期中考 寶石奇兵 容許的排序演算法: Θ(n lg n) , ex: merge sort, quick sort, heap sort…. 排序的標準: (1) 分數愈大愈前面 (2) 時間愈短愈前面 (3) 字典排序愈小愈前面 最後再循序找名次就可以了。
: Boxes ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11003: Boxes 解題者:蔡欣燁 解題日期: 2007 年 3 月 19 日.
五小專案 黃詩晴 章乃云. 目錄 計算機 智慧盤 拼圖 記憶大挑戰 數學題庫 心得 參考文獻.
: OPENING DOORS ? 題組: Problem Set Archive with Online Judge 題號: 10606: OPENING DOORS 解題者:侯沛彣 解題日期: 2006 年 6 月 11 日 題意: - 某間學校有 N 個學生,每個學生都有自己的衣物櫃.
: ShellSort ★★☆☆☆ 題組: Problem D 題號: 10152: ShellSort 解題者:林一帆 解題日期: 2006 年 4 月 10 日 題意:烏龜王國的烏龜總是一隻一隻疊在一起。唯一改變烏龜位置 的方法為:一隻烏龜爬出他原來的位置,然後往上爬到最上方。給 你一堆烏龜原來排列的順序,以及我們想要的烏龜的排列順序,你.
消費者物價指數反映生活成本。當消費者物價指數上升時,一般家庭需要花費更多的金錢才能維持相同的生活水準。經濟學家用物價膨脹(inflation)來描述一般物價持續上升的現象,而物價膨脹率(inflation rate)為物價水準的變動百分比。
: Problem E - Beverages ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 11060: Problem E - Beverages 解題者:李重儀 解題日期: 2008 年 3 月 4 日 題意: Dilbert 大學剛畢業,他決定要和朋友出去。他有奇怪的嗜好,
Chapter 3 Growth of Functions Asymptotic notation Θ-notation: f(n) = Θ(g(n)) , g(n) is an asymptotically tight bound for f(n) 。 Θ(g(n)) = {f(n)|
STAT0_sampling Random Sampling  母體: Finite population & Infinity population  由一大小為 N 的有限母體中抽出一樣本數為 n 的樣 本,若每一樣本被抽出的機率是一樣的,這樣本稱 為隨機樣本 (random sample)
: Matrix Decompressing ★★★★☆ 題組: Contest Volumes with Online Judge 題號: 11082: Matrix Decompressing 解題者:蔡權昱、劉洙愷 解題日期: 2008 年 4 月 18 日 題意:假設有一矩陣 R*C,
第 4 章 迴歸的同步推論與其他主題.
期中考參考解答 Date: 2005/12/14 Multimedia Information Systems.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
Monte Carlo Simulation Part.2 Metropolis Algorithm Dept. Phys. Tunghai Univ. Numerical Methods C. T. Shih.
Chapter 13 塑模靜態觀點:物件圖 Static View : Object Diagram.
Introduction to Java Programming Lecture 17 Abstract Classes & Interfaces.
國立中央大學電機工程學系 99 學年度第 2 學期 助教會議 中央大學電機工程學系 工程認證 1.
: The largest Clique ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11324: The largest Clique 解題者:李重儀 解題日期: 2008 年 11 月 24 日 題意: 簡單來說,給你一個 directed.
Matlab Assignment Due Assignment 兩個 matlab 程式 : Eigenface : Eigenvector 和 eigenvalue 的應用. Fractal : Affine transform( rotation, translation,
: Tight words ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: : Tight Words 解題者:鐘緯駿、林一帆 解題日期: 2006 年 03 月 14 日 題意: 給定數字 k 與 n (0 ≦ k.
: War on Weather ★★☆☆☆ 題組: Contest Volumes Archive with Online Judge 題號: 10915: War on Weather 解題者:陳明凱 題意:題目總共會給你 k 個點座標代表殺手衛星的位置, 距離地球表面最少 50 公里以上,並且會給你.
: Happy Number ★ ? 題組: Problem Set Archive with Online Judge 題號: 10591: Happy Number 解題者:陳瀅文 解題日期: 2006 年 6 月 6 日 題意:判斷一個正整數 N 是否為 Happy Number.
: Fast and Easy Data Compressor ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10043: Fast and Easy Data Compressor 解題者:葉貫中 解題日期: 2007 年 3.
Chapter 2 Getting Started Insertion Sort: 能有效率地排序小數字的演算法 範例 :
: Problem A : MiniMice ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11411: Problem A : MiniMice 解題者:李重儀 解題日期: 2008 年 9 月 3 日 題意:簡單的說,題目中每一隻老鼠有一個編號.
: Ahoy, Pirates! ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11402: Ahoy, Pirates! 解題者:李重儀 解題日期: 2008 年 8 月 26 日 題意:有一個海盜島有 N 個海盜,他們的編號 (id)
Fugacity Coefficient and Fugacity
: Multisets and Sequences ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11023: Multisets and Sequences 解題者:葉貫中 解題日期: 2007 年 4 月 24 日 題意:在這個題目中,我們要定義.
:Nuts for nuts..Nuts for nuts.. ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 10944:Nuts for nuts.. 解題者:楊家豪 解題日期: 2006 年 2 月 題意: 給定兩個正整數 x,y.
資料結構實習-一 參數傳遞.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2008.
公用品.  該物品的數量不會因一人的消費而受到 影響,它可以同時地被多人享用。 角色分配  兩位同學當我的助手,負責:  其餘各人是投資者,每人擁有 $100 , 可以投資在兩種資產上。  記錄  計算  協助同學討論.
Management Abstracts Retrieval System; MARS 檢索操作.
Section 4.2 Probability Models 機率模式. 由實驗看機率 實驗前先列出所有可能的實驗結果。 – 擲銅板:正面或反面。 – 擲骰子: 1~6 點。 – 擲骰子兩顆: (1,1),(1,2),(1,3),… 等 36 種。 決定每一個可能的實驗結果發生機率。 – 實驗後所有的實驗結果整理得到。
Teacher : Ing-Jer Huang TA : Chien-Hung Chen 2015/6/25 Course Embedded Systems : Principles and Implementations Weekly Preview Question CH 2.4~CH 2.6 &
函式 Function Part.2 東海大學物理系‧資訊教育 施奇廷. 遞迴( Recursion ) 函式可以「呼叫自己」,這種動作稱為 「遞迴」 此程式的執行結果相當於陷入無窮迴圈, 無法停止(只能按 Ctrl-C ) 這給我們一個暗示:函式的遞迴呼叫可以 達到部分迴圈的效果.
: GCD - Extreme II ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11426: GCD - Extreme II 解題者:蔡宗翰 解題日期: 2008 年 9 月 19 日 題意: 最多 20,000 組測資,題目會給一個數字.
JAVA 程式設計與資料結構 第二十章 Searching. Sequential Searching Sequential Searching 是最簡單的一種搜尋法,此演 算法可應用在 Array 或是 Linked List 此等資料結構。 Sequential Searching 的 worst-case.
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
: Expect the Expected ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11427: Expect the Expected 解題者:李重儀 解題日期: 2008 年 9 月 21 日 題意:玩一種遊戲 (a game.
845: Gas Station Numbers ★★★ 題組: Problem Set Archive with Online Judge 題號: 845: Gas Station Numbers. 解題者:張維珊 解題日期: 2006 年 2 月 題意: 將輸入的數字,經過重新排列組合或旋轉數字,得到比原先的數字大,
演算法課程 (Algorithms) 國立聯合大學 資訊管理學系 陳士杰老師 Course 7 貪婪法則 Greedy Approach.
Extreme Discrete Summation ★★★★☆ 題組: Contest Archive with Online Judge 題號: Extreme Discrete Summation 解題者:蔡宗翰 解題日期: 2008 年 10 月 13 日.
Building a knowledge base for MIS research: A meta-analysis of a systems success model Mark I Hwang, John C Windsor, Alan Pryor Information Resources Management.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2009.
: Problem E Antimatter Ray Clearcutting ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11008: Problem E Antimatter Ray Clearcutting 解題者:林王智瑞.
Teacher : Ing-Jer Huang TA : Chien-Hung Chen 2015/6/30 Course Embedded Systems : Principles and Implementations Weekly Preview Question CH7.1~CH /12/26.
:Commandos ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 11463: Commandos 解題者:李重儀 解題日期: 2008 年 8 月 11 日 題意: 題目會給你一個敵營區內總共的建築物數,以及建築物 之間可以互通的路有哪些,並給你起點的建築物和終點.
函式 Function 東海大學物理系‧資訊教育 施奇廷. 函式簡介 當程式越來越大、越複雜時,程式的維護、 除錯會變得更困難,此時必須引入函式來 簡化程式或將程式分段,將程式重複的部 分改寫為函式,將程式「模組化」 這種作法有下列優點:節省程式發展的時 間、邏輯容易瞭解、程式容易除錯、可分 工合作完成程式.
資料結構實習-六.
1 Introduction to Java Programming Lecture 3 Mathematical Operators Spring 2008.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2010.
: SAM I AM ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11419: SAM I AM 解題者:李重儀 解題日期: 2008 年 9 月 11 日 題意: 簡單的說,就是一個長方形的廟裡面有敵人,然 後可以橫的方向開砲或縱向開砲,每次開砲可以.
: Finding Paths in Grid ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11486: Finding Paths in Grid 解題者:李重儀 解題日期: 2008 年 10 月 14 日 題意:給一個 7 個 column.
:Problem E.Stone Game ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10165: Problem E.Stone Game 解題者:李濟宇 解題日期: 2006 年 3 月 26 日 題意: Jack 與 Jim.
財務管理概論 劉亞秋‧薛立言 合著 (東華書局, 2007)
幼兒行為觀察與記錄 第八章 事件取樣法.
1 Introduction to Java Programming Lecture 3 Mathematical Operators Spring 2009.
1 Chemical and Engineering Thermodynamics Chapter 1 Introduction Sandler.
VHDL語法(3).
: How many 0's? ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11038: How many 0’s? 解題者:楊鵬宇 解題日期: 2007 年 5 月 15 日 題意:寫下題目給的 m 與 n(m
1 生物計算期末作業 暨南大學資訊工程系 2003/05/20. 2 如何從 C/C++ 讀入參數 int main(int argc, char* argv[])  argc: 參數的個數, argc>0  argv[0]: 目前被執行的檔案名稱,以字串表示  argv[1]: 第一個參數,以字串表示.
Presentation transcript:

1 生物計算期末作業 暨南大學資訊工程系 2003/05/13

2 compare f1 f2  只比較兩個檔案 f1 與 f2 ,比完後將結果輸出。 compare directory  以兩兩比對的方式,比對一個目錄下所有檔案的相 似程度。  將相似度很高的檔案做成報表輸出,報表中至少要 包含 被判定相似程度很高的檔名清單。 被認定相似的總比數。 將所有檔名排序,並列出與哪些檔案相似。

3 假設我們有 f1 f2 f3 f4 f5 五個檔案:  相似清單: f1 f4 f5  相似總比數: 3  相似關係 f1: f4 f5 f2 f3 f4: f1 f5 f5: f1 f4

4 移除 移除所有的 comments :  /* ……… */  // ………

5 Keywords in ANSI C++

6 Keywords in ANSI C Keywords 是重要的比對要素。

7 Operators and Punctuation Operators 也是重要的比對要素。

8 White Space Newline \n Horizontal tab \t Vertical tab \v Carriage return \r Form feed \f Blank

9 將 input file 切割成 tokens 運用 operators 、 punctuations 、與 white spaces ,將 input file 切成 tokens :  x1 = wide * sin(angle); x1 = wide * sin ( angle ) ;

10  if (1 != scanf("%c", &ch)) return 0; if ( 1 != scanf ( "%c" ) return 0 ; 注意 ,字串要特別處理。

11 建立 symbol table 我們將切出來的 tokens 全部建立在一個 symbol table 中,然後將 table 中的 tokens 編號。 在建 table 時,有幾點要注意:  先在 table 中內建 keywords 、 operators 、 punctuations ,這樣可使得被內建的這些 tokens 有 固定的 ID 。  所有 C/C++ 標準內建函式庫需要先建在 table 裡。  Scope 的問題先不處理,但如果同學要處理也是做 得到的。

12 處理 identifiers 會遇到的問題 同一檔案中名字相同,但卻表示不同的變數:  scoping 、 operator overloading 、 function name overload 兩個要比較的檔案中,名稱不同但實際上卻相 同的兩個 identifier 。  User defined functions 兩個要比較的檔案中,名稱一樣,而實際上也 是相同的兩個名稱:  C/C++ library

13 Scope 的問題 void f() { int a;... } void g() { int a;... } 兩個 a 不同,但卻被我們當成一樣。

14 Alias 的問題 void f() { printf( ……); } void g() {... } void g() { printf( …… ); } void f() {... }

15 Macro 造成的問題 #define A printf #define A (B) 先不處理

16 所以我們處理的方式是採取先內建一些標準 C/C++ 的 identifiers 、 keywords 、 operators 、 punctuation 在 symbol table 中。 對於 user defined 的 identifiers ,降低 match/mismatch 的分數。

17 Keywords 的分類 Data type :  整數: int 、 short 、 signed 、 unsigned 、 long  浮點: float 、 double 、 long double  字串: char 、 char* Flow control :  for 、 while 、 do 幾乎是可以忽略的 keywords :  auto 、 const 、 extern 、 register 、 static 、 volatile 同類的 keywords 比對時給分要比較高。

18 可以考慮用 hash table 建 symbol table 當 hash 發生 collision 時,用 separate chaining 的方式處理。

19 Loop normalization (不一定要做) For (s1; s2; s3) { …}  s1  {  If (s2) break;  …  s3  Goto  }

20 測試資料 大部分都是 C ,只有很少的會用到一部分 C++ 的功能,但不會用到 Class 。 比賽時會有另一組測試資料。

21 False positive:  被誤判成有密切關連 False negative:  原來有密切關連,但卻被誤判成沒關連 同學的程式要降低這兩項發生的比率。

22 如何找 disjoint highest similar regions

23