Space complexity is a measure of the space used by an algorithm, as opposed to the amount of time it uses.

Wasted space

Linked lists

Different data structures ‘waste’ a different amount of space based on the amount of non-value relevant data they hold. For example, in a null terminated single linked list, this would be technically n pointers wasted in a n-long linked list, and if you consider just null values, at least one null value is needed to terminate the single linked list.

Array

For Array, they technically do not waste any space when storing the values, but when copying these values for example, they need to be entirely copied. This means Array have a different measure for capacity and size. Best case scenario, the capacity and size are the same, in which case they waste no space, and at worst they effectively waste n space by having the capacity be double the size.

Trees

For binary trees, the pointers take up 2n space as every node contains 2 pointers to the next. When it comes to just null values, it depends on the perfect-ness of the tree. The leaf nodes will still inevitably contain null pointers though. The amount of null pointers contained by a Binary Tree is always n + 1.

In a r-ary trees, the amount of null pointers is always going to be (r-1)n + 1 null pointers.