bk99.de entertain the web since 1997

Big O as a reference for data structures

Summary

Eric Rowell compares the running time and memory requirements of common data structures and sorting algorithms in a compact overview. The overview contains search, insertion and deletion costs. Several sorting algorithms are compared graphically.

Ideas

  • Big O describes growth as the input size increases.
  • Arrays and lists trade access speed for flexible changes.
  • Hash tables offer expected constant-time access under good assumptions.
  • Sorting methods differ in time, memory and stability.

Insights

  • Asymptotics compares growth, not real running time for small inputs.
  • Averages can hide dangerous worst cases.
  • The choice of data structure follows the actual operations rather than habit.

Facts

  • Space complexity is also shown.

Recommendations

  • Measure the input sizes and mix of operations of the real system.
  • Check the assumptions behind average running times.

References

Read the original article

Search the Web Archive