I'm learning about different sorting algorithms and their time/space complexities and saw that algorithms such as bubble sort and insertion sort have a space complexity of O(1).
This struck me as weird, because surely the lowest space complexity possible would be O(n) (as in, the memory required to store the data set and nothing more)?
The space complexity is actually the additional space complexity used by your algorithm, i.e. the extra space that you need, apart from the initial space occupied by the data. Bubble-sort and insertion sort use only a constant additional space, apart from the original data, so they are O(1) in space complexity.