阿摩線上測驗
登入
首頁
>
研究所、轉學考(插大)-資料結構
>
112年 - 112 國立臺北大學_日間學士班轉學生招生考試試題_資訊工程學系日間學士班3年級:資料結構#147429
> 申論題
3. Describe the design of using circular linked list for polynomial add, including: (10%)
(1) add each polynomial by exponential order
相關申論題
(2) the control of processing values in the linked lists
#606979
(3) The ending condition of completing the adding process
#606980
4. Use linked list to implement a stack in C: (10%) typedef struct node { int value; node *next;} void push (node **top, int new_value) { // assume top is not null node *new_node = (node *) malloc (sizeof (node)); // add new_node to stack by top } int pop (node **top) { // assume top is not null int value; node *deleting_node = *top; // remove the deleting node from stack free(deleting_node); return value; }
#606981
5. Use queue to implement level order traversal conversion in C: (15%) void level_order (tree *root) { //assume root is not null node *front, *rear; // visit tree nodes based on level order by using queue // use queue by front, rear, enqueue(&rear, root), root =dequeue(&front) // print the values of tree nodes // describe the ending condition }
#606982
6. Implement Sparse Matrix Transpose function without nested for loop.(15%) void fast_transpose(term a[ ], term b[ ]) { int row_terms[20], starting_pos[20], i, j; int num_cols = a[0].col, num_terms = a[0].value; b[0].row = num_cols; b[0].col = a[0].row; b[0].value = num_terms; starting_pos[0]=1; bzero(row_terms); // Set row_terms[] value // Set starting_pos[] value // Set b[] value }
#606983
7. Maze path search function by stack. (25%) void path() { // assume int maze[30][30] and offsets move[8] has been set in main function // typedef struct {int v; int h;} offsets; int i, row, col, next_row, next_col, dir, found = 0, top =0, mark[30][30]; typedef struct { int row; int col; int dir;} element element position, stack[100]; mark[1][1] = 1; stack[0].row = 1; stack[0].col = 1; stack[0].dir = 0; // Use stack to get current row, col, dir // Use dir to calculate next_row, next_col // Use next_row, next_col to check this move (1) arrive exit, or // (2) become a legal move; add this move into the stack or // (3) check other dir }
#606984
相關試卷
115年 - 115 國立嘉義大學_碩士班招生考試試題_資訊工程學系:資料結構#143912
115年 · #143912
114年 - 114 國立嘉義大學_碩士班招生考試試題_資訊工程學系:資料結構#144138
114年 · #144138
113年 - 113 國立嘉義大學_碩士班招生考試試題_資訊工程學系:資料結構#144167
113年 · #144167
112年 - 112 國立臺北大學_日間學士班轉學生招生考試試題_資訊工程學系日間學士班3年級:資料結構#147429
112年 · #147429
112年 - 112 國立嘉義大學_碩士班招生考試試題_資訊工程學系:資料結構#144165
112年 · #144165
111年 - 111 國立嘉義大學_碩士班招生考試試題_資訊工程學系:資料結構#145441
111年 · #145441
110年 - 110 國立嘉義大學_碩士班招生考試試題_資訊工程學系:資料結構#145491
110年 · #145491
110年 - 110 國立臺灣科技大學_碩士班招生試題_電子工程系:資料結構#112844
110年 · #112844
110年 - [非官方正解]110 國立高雄科技大學_碩士班招生考試_電腦與通訊工程系:資料結構(乙組)#110488
110年 · #110488
110年 - 110 國立高雄科技大學_碩士班招生考試_資訊工程系:資料結構#110422
110年 · #110422