Top "Space-complexity" questions

The space complexity of an algorithm quantifies the amount of memory taken by an algorithm to run as a function of the size of the input to the problem.

Merge Sort Time and Space Complexity

Let's take this implementation of Merge Sort as an example void mergesort(Item a[], int l, int r) { if (r &…

algorithm time-complexity space-complexity
Will Arrays.sort() increase time complexity and space time complexity?

There is an array related problem, the requirement is that time complexity is O(n) and space complexity is O(1). …

java arrays sorting time-complexity space-complexity
Why does QuickSort use O(log(n)) extra space?

I have implemented the below quicksort algorithm. Online I've read that it has a space requirement of O(log(n)). …

java algorithm sorting quicksort space-complexity
Time/Space Complexity of Depth First Search

I've looked at various other StackOverflow answer's and they all are different to what my lecturer has written in his …

algorithm time-complexity depth-first-search space-complexity
What is O(1) space complexity?

I am having a hard time understanding what is O(1) space complexity. I understand that it means that the space …

complexity-theory space-complexity
Real world examples to decide which sorting algorithm works best

I am risking this question being closed before i get an answer, but i really do want to know the …

algorithm sorting time-complexity space-complexity
Space complexity of recursive function

Given the function below: int f(int n) { if (n <= 1) { return 1; } return f(n - 1) + f(n - 1); } I …

big-o space-complexity
How to calculate the space complexity of function?

I understood the basic that if I have a function like this: int sum(int x, int y, int z) { …

algorithm space-complexity
How to determine memory and time complexity of an algorithm?

I am not good at determining time and memory complexities and would appreciate it if someone could help me out. …

algorithm time-complexity space-complexity
Meaning of the terms O(1) space and without using extra space

This is slightly confusing to me. What should be my approach of solving a given problem when the constraint is …

performance algorithm space-complexity