MwA: Complexities Flashcards
1
Q
What is the complexity of Dijkstra’s algorithm?
A
O(n²), where n is the number of nodes
2
Q
What is the complexity of calculating the mean?
A
O(n)
3
Q
What is the complexity of calculating the sum of triangle numbers?
A
O(n²)
4
Q
What is the complexity of first-fit and first-fit decreasing algorithm?
A
O(n²), where n is the number of boxes
5
Q
What is the complexity for quick sort?
A
O(n²), where n is the number of numbers in the list to be sorted and you are counting the number of comparisons to be made
6
Q
What is the complexity of Kruskal’s and Prims algorithms?
A
O(n²), when n is the number of arcs