Big-O Searching Complexities

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

average case time complexity Binary search of a Sorted array of n elements

O(log(n))

worst case time complexity Binary search of a Sorted array of n elements

O(log(n))

worst case time complexity of Linear (Brute Force) Array

O(n)

worst space complexity for a Depth First Search (DFS) Graph of |V| vertices and |E| edges

O(|V|)

worst space complexity for a Shortest path by Bellman-Ford Graph with |V| vertices and |E| edges

O(|V|)

average case time complexity for a Shortest path by Dijkstra, using an unsorted array as priority queue Graph with |V| vertices and |E| edges

O(|V|^2)

worst case time complexity for a Shortest path by Dijkstra, using an unsorted array as priority queue Graph with |V| vertices and |E| edges

O(|V|^2)

average time complexity for a Shortest path by Bellman-Ford Graph with |V| vertices and |E| edges

O(|V||E|)

worst time complexity for a Shortest path by Bellman-Ford Graph with |V| vertices and |E| edges

O(|V||E|)

worst case space complexity for a Shortest path by Dijkstra, using an unsorted array as priority queue Graph with |V| vertices and |E| edges

O(|V|)

worst case space complexity of Shortest path by Dijkstra, using a Min-heap as priority queue Graph with |V| vertices and |E| edges

O(|V|)

worst space complexity for Breadth First Search (BFS) Graph of |V| vertices and |E| edges

O(|V|)

worst case space complexity Binary search of a Sorted array of n elements

O(1)

average case time complexity of Linear (Brute Force) Array

O(n)

average time complexity for Shortest path by Dijkstra, using a Min-heap as priority queue Graph with |V| vertices and |E| edges

O((|V| + |E|) log |V|)

worst case time complexity of Shortest path by Dijkstra, using a Min-heap as priority queue Graph with |V| vertices and |E| edges

O((|V| + |E|) log |V|)

worst case space complexity of Linear (Brute Force) Array

O(1)

Worst case time complexity of Breadth First Search (BFS) of a Graph of |V| vertices and |E| edges

Worst O(|E| + |V|)

Worst case time complexity of Depth First Search (DFS) of a Graph of |V| vertices and |E| edges

Worst O(|E| + |V|)


Kaugnay na mga set ng pag-aaral

Chapter 14: Feeding and Eating Disorders

View Set

Chapter 14: The Civil War, 1861-1865

View Set

Ch 43 Grief & Loss (Psychological & Developmental Variables)

View Set

Accounting Information Systems Chapters 15-17

View Set

Ch 37 The Cold War Begins 1945-1952

View Set

Part 3: Contracts Chapter 13 Reality of Consent

View Set