阿摩線上測驗
登入
首頁
>
中山◆電機◆資料結構
> 109年 - 109 國立中山大學_碩士班招生考試_電機系(丙組):資料結構#106105
109年 - 109 國立中山大學_碩士班招生考試_電機系(丙組):資料結構#106105
科目:
中山◆電機◆資料結構 |
年份:
109年 |
選擇題數:
25 |
申論題數:
0
試卷資訊
所屬科目:
中山◆電機◆資料結構
選擇題 (25)
1.If the address of A[2] is
, what is the address of A[5]? (A)
; (B)
; (C)
; (D)
2.How many times kkk will be called in the function body of kkk(A,0,4)? (A) 1; (B) 2; (C)3; (D) 4.
3.What is the time complexity of this function? (A) O(n); (B) O(log
2
n); (C)O(n
2
); (D) O(n
3
).
複選題
4.Let A=[20,80,30,40,10,70,50. After executing kkk(A,0,7), which of the following are true? (A) A[0]=70; (B) A[2]=10; (C)A[4]=50]; (D) A[6]=20.
複選題
5.Let A=[15,25,35,45,55,65,75,85J. After executing kkk(A,0,8), which of the following are true? (A) A[1]=75; (B) A[3]=55; (C)A[5]=35 (D) A[7]=65.
6.We use an array A of 10 elements to implement the stack. Which one is true for declaring the array in C? (A) integer A:10; (B) integer A[0,9]; (C)integer A[1, 10]; (D) integer A[10].
7.We use the array A as defined above to implement the stack. We want to store the first integer at index=0. Let the latest input be stored at index=top. What is the value of top for the empty stack? (A) top=0; (B) top=1; (C)top=-1; (D) top=9.
8.We use the linked-based implementation for the stack. Let the latest input be stored at the location with address in first. What is the value of first for the empty stack? (A) first=-1; (B) first=0; (C)first=1; (D) first=2.
複選題
9.We use the array A as defined above to implement the stack. After executing the 10 operations in sequence, which of the following are true? (A) top=1; (B) A[O]=4; (C)A[1]=5; (D) The stack has 3 integers.
複選題
10. We use the linked-based implementation as defined above for the stack. After executing the 10 operations, which of the following are true? (A) first is not O; (B) first contains the address where 5 is stored; (C)Alfirst]=4; (D) A -> first = 4.
11. We use Bubble Sort to sort the array in ascending order. What is A[8] after the first pass? (A) 661; (B) 556; (C)682; (D) 245.
12. We use Bubble Sort to sort the array in ascending order. What is A[7] after the second pass? (A) 122 (B) 661; (C)556; (D) 225.
13. We use Quick Sort to sort the array in ascending order. For each partition, let the rightmost element be the pivot. Which one stores 245 after the first partition? (A) A[3]; (B) A[7); (C)A(5]; (D) A[4].
複選題
14. We use Quick sort to sort the aray in ascending order. Which of the following are false after the first partition? (A) A[0]=240; (B) A[8]=682; (C)A[3]=341; (D) A[7]=661.
15. We use Heap Sort to sort the array in ascending order. But first, we have to convert the array into a maxheap. Which of the following are true in the resulting maxheap? (A) A[0]=682; (B) A[3]=341; (C) A[5]=240; (D) A[8]=245.
16. We create binary trees for these integers. What is the minimum height of all the possible trees? (A) 1; (B) 2; (C)3; (D) 4.
17. We create binary trees for these integers. What is the maximum height of all the possible trees? (A) 10; (B) 9;(C)8; (D) 7.
18. We create an AVL tree by considering the integers one by one, starting with the first one, 30. Which of the following is true? (A) The height of the resulting tree is 5; (B) The root of the resulting tree is 75; (C)The node for 46 has one child; (D) The parent of 99 is the node for 75.
複選題
19. We create a binary search tree by considering the integers one by one, starting with the first one, 30. Which of the following are true? (A) The node for 75 is a leaf node; (B) The node for 42 is an internal node; (C)The node for 99 has only one child; (D) The height of the resulting tree is 5.
複選題
20. Based on the binary search tree obtained in Question 19, we delete 99 from the tree. Which of the following are true? (A) The parent of 75 is the node for 46; (B) The node for 30 has two children; (C) The node for 70 is an internal node; (D) The height of the resulting tree is 4. questions.
21. We find a spanning tree for the graph using the depth-first search algorithm, starting with vertex e. Note that if two or more vertices qualify, then the one with the least alphabetical order is selected. What is the sum of the weights involved in the resulting tree? (A) 31; (B) 32; (C)33; (D) 34.
22. We find a spanning tree for the graph using the breadth-first search algorithm, starting with vertex e. Note that if two or more vertices qualify, then the one with the least alphabetical order is selected. What is the sum of the weights involved in the resulting tree? (A) 40; (B) 39; (C)38;(D) 37.
23. We find a spanning tree for the graph using the Prim's algorithm, starting with vertex e. Note that if two or more vertices qualify, then the one with the least alphabetical order is selected. What is the sum of the weights involved in the resulting tree? (A) 30; (B) 29; (C)28; (D) 27.
24. Which of the following are true for the resulting tree obtained in Question 21? (A) The node following node a is node g; (B) The edge (e,g) is contained in the tree; (C)The edge (c,d) is contained in the tree; (D) The edge (b,c) is contained in the tree.
複選題
25. Which of the following are true for the resulting tree obtained in Question 23? (A) The edge (a,g) is contained in the tree; (B) The edge (a,b) is contained in the tree; (C)The edge (b,c) is contained in the tree; (D) The edge (c,d) is contained in the tree.
申論題 (0)