Adjacency List Representation
📖 Scenario: Imagine you are organizing a small social network where each person can be friends with others. You want to store who is friends with whom in a way that is easy to look up and update.
🎯 Goal: You will build an adjacency list representation of a graph using a TypeScript object. Each key will be a person's name, and the value will be a list of their friends' names.
📋 What You'll Learn
Create an adjacency list object with exact keys and values
Add a new person with an empty friends list
Add friends to a person's list
Print the adjacency list to show the connections
💡 Why This Matters
🌍 Real World
Adjacency lists are used to represent networks like social connections, road maps, or computer networks efficiently.
💼 Career
Understanding adjacency lists is important for roles in software development, data analysis, and network engineering where graph data structures are common.
Progress0 / 4 steps