Compare common data structures and select appropriate ones for specific tasks. For arrays, linked lists, stacks, queues, hash tables, binary search trees (balanced and unbalanced), heaps, and graphs, state average and worst-case time/space complexities for search, insert, delete, and iteration; list key invariants; and provide one example where each excels and one where it performs poorly.