A star graph has one center vertex connected to all other vertices. The center has degree , and all other vertices have degree .
You could build an adjacency list and count degrees for each vertex. Check if one vertex has degree and all others have degree . This works but requires storing the graph.
There is a smarter approach using edge counting. I'll show you the trick in the next unit.