Analyze the complexity of Prim's algorithm. Understand how adjacency lists and priority queues optimize its time complexity for sparse graph data.