Select the correct option to test your answer:
More Computer Questions
Given the following program, what will be the 3rd number that'd get printed in the output sequence for the given input? #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 0
Which of the following is a Non-modifying Sequence Operation?
Can "SELECT" clause be used without the clause "FROM"?
What is the term for the use of AI and data analytics to optimize the design and layout of urban spaces and infrastructure?
What will be the output of the following C++ code? #include <iostream> #include <string> #include <cstdlib> using namespace std; template<class T, class U = char> class A { T a; U b; public: A(T a_val, char b_val = '$'){ this->a = a_val; this->b = b_val; } void print(){ cout<<a<<' '<<b<<endl; } }; int main(int argc, char const *argv[]) { A <int, int> a1(5,10); A <int> a2(5); A <float> a3(10.0); return 0; }