Data Structures and Algorithms

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

21 Terms

1
New cards

True, AVL Tree are more balanced than Red-Black Tree

2
New cards

BFS用?實作

Queue

3
New cards

DFS用?實作

Stack

4
New cards

List can be constructed to a BST with worst case O(n)

False, skewed tree will have worst case O(n2)

“The height of tree is n and there are n elements“

5
New cards
Quick Sort: Best/Avg/Worst(when?)

O(nlogn)/O(nlogn)/O(n^2). When the data are sorted

6
New cards
Merge Sort: Best/Avg/Worst

O(nlogn)/O(nlogn)/O(nlogn)

7
New cards
Insertion Sort:Best(when?)/Avg/Worst

O(n)/O(n^2)/O(n^2)/  when the data are sorted

8
New cards

Selection Sort:Best/Avg/Worst

O(n^2)/O(n^2)/O(n^2)

9
New cards
Which is not stable sorting algorithm: Bubble,Insertion,Selection,Merge,Quick,Heap,Counting,Radix,Bucket
Selection,Quick,Heap
10
New cards

If a weighted graph with weight w_i\geq0  , then if a new graph with w_i+M,M\geq0 , the shortest path will remain the same.

False, 如果該shortest path有比較多edge,則他有可能不復為最短路徑
11
New cards
Have Euler Circuit
Every nodes have even degree
12
New cards
Have Euler Path
Only 2 nodes have odd degree
13
New cards
Preorder
中左右
14
New cards
Inorder
左中右
15
New cards
Postorder
左右中
16
New cards
Time complexity of 0-1 knapsack
O(nW) w is the size of the backpack
17
New cards

Time complexity for k-coloring problem when
1.k <= 2 
2. k >=3 

  1. O(V+E) ( 判斷是否為二分圖)
    2. NP-C

18
New cards
二分圖一定沒有 WHAT?
奇環
19
New cards
degree = t b tree's node can have at most ? key and ? child. Also the relation between degree and order?

degree=\lceil\frac{order}{2}\rceil
keys = 2t-1
child = 2t

20
New cards

It’s possible to run radix sort in linear time with respect to the length of the list

"True, but only when the length of elements are all fixed, otherwise it will be O(kn) k for digit,n for # of elements"

21
New cards

AD