Facebook
From Chartreuse Lemur, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 66
  1. // C++ implementation of the approach
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. // Function to return the number of regions in a Planar Graph
  6. int Regions(int Vertices, int Edges)
  7. {
  8.         int R = Edges + 2 - Vertices;
  9.  
  10.         return R;
  11. }
  12.  
  13. // Driver code
  14. int main()
  15. {
  16.         int V = 5, E = 7;
  17.  
  18.         cout << Regions(V, E);
  19.  
  20.         return 0;
  21. }
  22.