Q121
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
153
Questions
7/8
Page
Pick an option on a question to see the right answer and solution.
Q121
Open questionSelect an option to see the answer and solution.
Q122
Open questionSelect an option to see the answer and solution.
Q123
Open questionSelect an option to see the answer and solution.
Q124
Open questionSelect an option to see the answer and solution.
Q125
Open questionSelect an option to see the answer and solution.
Q126
Open questionSelect an option to see the answer and solution.
Q127
Open questionSelect an option to see the answer and solution.
Q128
Open questionSelect an option to see the answer and solution.
Q129
Open questionSelect an option to see the answer and solution.
Q130
Open questionSelect an option to see the answer and solution.
Q131
Open questionSelect an option to see the answer and solution.
Q132
Open question
Select an option to see the answer and solution.
Q133
Open question
Select an option to see the answer and solution.
Q134
Open questionSelect an option to see the answer and solution.
Q135
Open question#include <bits/stdc++.h>
using namespace std;
int cur=0;
int G[10][10];
bool visited[10];
deque <int> q;
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];
for(int i=0;i<n;i++)
visited[i]=false;
fun(n);
return 0;
}
void fun(int n)
{
cout<<cur<<" ";
visited[cur]=true;
q.push_back(cur);
do
{
for(int j=0;j<n;j++)
{
if(G[cur][j]==1 && !visited[j])
{
q.push_back(j);
cout<<j<<" ";
visited[j]=true;
}
}
q.pop_front();
if(!q.empty())
cur=q.front();
}while(!q.empty());
}
Input Sequence:-9
0 1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0
0 0 0 1 1 1 0 0 1
0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 1 0
0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 1 1
0 0 0 0 1 0 1 0 0
1 0 1 0 0 0 1 0 0Select an option to see the answer and solution.
Q136
Open questionSelect an option to see the answer and solution.
Q137
Open questionSelect an option to see the answer and solution.
Q138
Open questioni. Δ ii. ◊ iii. ∇ iv. T v. ⊥
Select an option to see the answer and solution.
Q139
Open questionSelect an option to see the answer and solution.
Q140
Open question
Select an option to see the answer and solution.