Adjacency Matrix Representation
📖 Scenario: You are working on a simple social network app. Each person can be friends with others. We want to represent these friendships using a grid where rows and columns show people, and a 1 means they are friends, 0 means not friends.
🎯 Goal: Build an adjacency matrix to show friendships between 4 people named Alice, Bob, Charlie, and Diana. Then, print the matrix to see the friendship connections clearly.
📋 What You'll Learn
Create a 4x4 adjacency matrix with exact values for friendships
Use a variable to store the number of people
Fill the matrix with 1s and 0s to represent friendships
Print the adjacency matrix row by row
💡 Why This Matters
🌍 Real World
Adjacency matrices are used in social networks, maps, and computer networks to show connections between nodes clearly.
💼 Career
Understanding adjacency matrices helps in roles like software development, data analysis, and network engineering where relationships between entities must be managed.
Progress0 / 4 steps