[理工] 資料結構
幾題題目
因為沒有答案只好來麻煩版上的大大們了QQ
(true or false)
1.The memory usage for doubly linked list is O(n^2),
where n is the number of element in the list.
這題我覺得是false 應該只有O(n)吧@@?
2.Let f(n) be a linear function of n .Then f(n)= Ω((logn)^k)for
any power of k.
這題我覺得是true 可是 因為 Ω的定義 雖然是下限 但是只能差常數倍
所以覺得怪怪的
3.Given a complete binary tree.Let's perform the post-order
traversal from the root and number the nodes with numbers
starting from 1.For a node with number k, its parent must be
numbered 2k or 2k+1.
這題我選false
4.The height of a 2-3-4 tree must be smaller than or equal
to the height of a 2-3 tree with the same data.
這題我選false
5.Given an arbitary directed graph , it takes O(2^n)time
to determine whether there exist a path between two nodes
, where n is the number of nodes.
這題我選false 應該是O(1)吧@@?!
6.Let f(n) be the Fibonacci series where f(0)=0 and f(1)=1
.Let H be a hash with 10 buckets, and let |H(i)| denote the
number of elements in the i's bucket,for i=0 to 9.
If we insert the first 12 numbers of Fibonacci series, that is
,f(0) to f(11), into the hash H with the following hash function
"h(n)=n^2%10".Then |H(4)|>|H(5)|.
這題我覺得是true
h(n)=n^2%10 我是用0,1,2,3,....,11去代 不知道對不對
以上 麻煩大家了!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.185.251.7
→
12/30 00:29, , 1F
12/30 00:29, 1F
→
12/30 00:30, , 2F
12/30 00:30, 2F
推
12/30 01:02, , 3F
12/30 01:02, 3F
→
12/30 01:03, , 4F
12/30 01:03, 4F
→
12/30 01:05, , 5F
12/30 01:05, 5F
→
12/30 01:24, , 6F
12/30 01:24, 6F
→
12/30 02:01, , 7F
12/30 02:01, 7F
→
12/30 02:13, , 8F
12/30 02:13, 8F
→
12/30 02:45, , 9F
12/30 02:45, 9F
→
12/30 02:45, , 10F
12/30 02:45, 10F
→
12/30 02:45, , 11F
12/30 02:45, 11F
→
12/30 10:08, , 12F
12/30 10:08, 12F
→
12/30 11:52, , 13F
12/30 11:52, 13F
→
12/30 11:53, , 14F
12/30 11:53, 14F
→
12/30 12:03, , 15F
12/30 12:03, 15F
→
12/30 12:04, , 16F
12/30 12:04, 16F
推
12/30 12:05, , 17F
12/30 12:05, 17F
→
12/30 12:13, , 18F
12/30 12:13, 18F
→
12/30 12:13, , 19F
12/30 12:13, 19F
感謝各位大大的幫忙 第四題我選TRUE但是打成falseQQ
另外想請問一下
第一題FALSE 想請問那應該是多少?!每一個node增加一個link的欄位
所以頂多是O(n+n)=O(n) 不知道對不對?!
※ 編輯: n791116 來自: 111.185.122.223 (12/30 12:56)
※ 編輯: n791116 來自: 111.185.122.223 (12/30 13:08)
推
12/30 13:28, , 20F
12/30 13:28, 20F
→
12/30 13:28, , 21F
12/30 13:28, 21F
→
12/30 13:28, , 22F
12/30 13:28, 22F
→
12/30 13:28, , 23F
12/30 13:28, 23F
→
12/30 13:28, , 24F
12/30 13:28, 24F
推
12/30 13:37, , 25F
12/30 13:37, 25F
→
12/30 13:46, , 26F
12/30 13:46, 26F
→
12/30 13:52, , 27F
12/30 13:52, 27F
→
12/30 13:52, , 28F
12/30 13:52, 28F
→
12/30 13:52, , 29F
12/30 13:52, 29F
題目來說的話應該是討論下限~~
反正下限 小於等於自己 ,上限 大於等於自己就可以了吧?!
感謝各位大大><祝大家新年快樂!!!XD
※ 編輯: n791116 來自: 111.185.251.7 (12/31 17:29)
討論串 (同標題文章)