For Which Type Of Graph The Given Program Wont Run Infinitely #1212

For which type of graph, the given program won’t run infinitely? The Input would be in the form of an adjacency Matrix and n is its dimension (1<n<10).</p> <pre><code class="language-cpp"> #include <bits/stdc++.h> using namespace std; int G[10][10]; void fun(int n); int main() { int num=0; int n; cin>>n; for(int i=0;i<n;i++) for(int j=0;j<n;j++) cin>>G[i][j]; fun(n); return 0; } void fun(int n) { for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(G[i][j]==1) j--; } </code></pre>

Online Quiz This multiple choice question (MCQ) is related to the book/course gs gs121 Data Structures and Algorithms. It can also be found in gs gs121 Graph - Adjacency Matrix - Quiz No.2.


Similar question(s) are as followings:



Online Quizzes of gs121 Data Structures and Algorithms

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background