阿摩線上測驗
登入
首頁
>
研究所、轉學考(插大)◆資料結構與演算法
>
112年 - 112 國立臺北大學_碩士班一般入學考試試題_資訊工程學系:資料結構與演算法#147280
> 申論題
題組內容
5.
(5分) (A)在C語言中,int list[5]和intplist[5]的有何不同,要如何将intplist[5]實作為2維陣列?
相關申論題
(20 分) (B)將此 inorder statement : AB+C(D-E)/(F+H) 轉為 postorder,並畫出它的二元樹。須按照以左到右讀取順序來做,以達到單一解答。同時,設計一個算法使用 stack 來實現上述 inorder 轉 postorder,並且以上述 statement 說明如何使用 stack 來做轉換。
#605726
6. (10 分) 使用 linked list 實作 stack,運用以下 C 語言程式:typedef struct node { int value; node *next;}void push (node **top, int new_value) { // assume top is not nullnode new_node = (node ) malloc (sizeof (node));// 實作以下敘述// add new_node to stack by top}int pop (node **top) { // assume top is not nullint value;node deleting_node = top;// 實作以下敘述// remove the deleting node from stack, get the value of deleting nodefree(deleting_node);return value;}
#605727
7. (15 分) 使用 stack 解決老鼠走迷宮問題 (Maze path search),設計並描述如何實作,包含 (A) 如何搜尋八個方向來移動 (B) 如何找到合法移動和出口 (C) 解決死路問題
#605728
1. (15分) Run the Prim's algorithm to generate a minimum spanning tree for the following graph. It is required that the initial vertex is s. Run the algorithm step by step to generate your tree. What is the tree weight?
#605729
2. (15 分) Given a file, we found that it consists of seven symbols a,b,c,d,e,f,g and their frequencies are as follows. | Alphabet | a | b | c | d | e | f | g | | --- | --- | --- | --- | --- | --- | --- | --- | | Frequency in the file | 12 | 26 | 43 | 13 | 9 | 5 | 15 | Use Huffman coding to encode these 7 symbols to achieve the minimum file size.
#605730
3. (5分) Give an asymptotic upper bound for the function \( \mathrm{T}(\mathfrak{n}) \) where \( \mathrm{T}(\mathfrak{n}) \) satisfies the recurrent equation \( \mathrm{T}(\mathfrak{n}) = 5\mathrm{T}(\mathfrak{n} / 4) + \mathfrak{n} \).
#605731
4. (15分) Let \( k \) be \( O(n) \). Describe an \( O(n) \)-time algorithm that, given a set \( S \subseteq \{1, \ldots, k\} \) of \( n \) integers and another integer \( x \), determines whether or not there exist two elements in \( S \) whose product is exactly \( x \).
#605732
5. (5分) (A)使用quick sort排序數列60804523698114752897563.7。並且說明每次移動數字時,所使用的條件和基準。
#605733
(5分) (B)將此inorder statement: \( A^{*}(B + C) + E^{*}F - H / I \) 轉為 postorder,並畫出它的二元樹。
#605734
(10分) (C)設計一個算法使用 stack 來實現上述 inorder 轉 postorder,需解釋如何處理括號和運算式的優先權。
#605735
相關試卷
115年 - 115 國立臺北大學_碩士班一般入學考試試題_資訊工程學系:資料結構與演算法#147260
115年 · #147260
114年 - 114 國立臺北大學_碩士班一般入學考試試題_資訊工程學系:資料結構與演算法#147250
114年 · #147250
113年 - 113 國立臺北大學_碩士班一般入學考試試題_資訊工程學系:資料結構與演算法#147281
113年 · #147281
112年 - 112 國立臺北大學_碩士班一般入學考試試題_資訊工程學系:資料結構與演算法#147280
112年 · #147280
111年 - 111 國立臺北大學_碩士班一般入學考試試題_資訊工程學系:資料結構與演算法#147272
111年 · #147272
110年 - 110 國立臺北大學_碩士班一般入學考試試題_資訊工程學系:資料結構與演算法#147276
110年 · #147276
110年 - [非官方正解]110 國立臺灣大學_碩士班招生考試_電信工程研究所丙組:資料結構與演算法(B)#113108
110年 · #113108
110年 - [非官方正解]110 國立中央大學_碩士班招生考試_資工類:資料結構與演算法#105890
110年 · #105890
109年 - 109 國立臺北大學_碩士班一般入學考試試題_資訊工程學系:資料結構與演算法#147273
109年 · #147273
109年 - 109 東吳大學_轉學生招生考試_資訊管理學系三年級︰資料結構#105850
109年 · #105850