Q501
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.
1,171
Questions
26/59
Page
Pick an option on a question to see the right answer and solution.
Q501
Open questionSelect an option to see the answer and solution.
Q502
Open questionSelect an option to see the answer and solution.
Q503
Open questionSelect an option to see the answer and solution.
Q504
Open questionSelect an option to see the answer and solution.
Q505
Open questionSelect an option to see the answer and solution.
Q506
Open questionSelect an option to see the answer and solution.
Q507
Open questionSelect an option to see the answer and solution.
Q508
Open questionSelect an option to see the answer and solution.
Q509
Open question#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node* next;
}*head;
int linear_search(int value)
{
struct Node *temp = head->next;
while(temp -> next != 0)
{
if(temp->val == value)
return 1;
temp = temp->next;
}
return 0;
}
int main()
{
int arr[6] = {1,2,3,4,5,6};
int n = 6,i;
head = (struct Node*)malloc(sizeof(struct Node));
head->next = 0;
struct Node *temp;
temp = head;
for(i=0; i<n; i++)
{
struct Node *newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->next = 0;
newNode->val = arr[i];
temp->next = newNode;
temp = temp->next;
}
int ans = linear_search(60);
if(ans == 1)
printf("Found");
else
printf("Not found");
return 0;
}Select an option to see the answer and solution.
Q510
Open questionSelect an option to see the answer and solution.
Q511
Open question
Select an option to see the answer and solution.
Q512
Open questionSelect an option to see the answer and solution.
Q513
Open questionSelect an option to see the answer and solution.
Q514
Open questionint fact(int n)
{
if(n == 0)
return 1;
return n * fact(n - 1);
}
int main()
{
int n = 5;
int ans = fact(n);
printf("%d",ans);
return 0;
}Select an option to see the answer and solution.
Q515
Open questionSelect an option to see the answer and solution.
Q516
Open questionSelect an option to see the answer and solution.
Q517
Open question#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node* next;
}*head;
int min_of_two(int a, int b)
{
if(a < b)
return a;
return b;
}
int recursive_get_min(struct Node* temp)
{
if(temp->next == 0)
return temp->val;
return min_of_two(temp->val,recursive_get_min(temp->next));
}
int main()
{
int n = 5, arr[5] ={1,1,1,1,1},i;
struct Node *temp, *newNode;
head = (struct Node*)malloc(sizeof(struct Node));
head -> next =0;
temp = head;
for(i=0;i<n;i++)
{
newNode =(struct Node*)malloc(sizeof(struct Node));
newNode->next = 0;
newNode->val = arr[i];
temp->next =newNode;
temp = temp->next;
}
int min_num = recursive_get_min(head->next);
printf("%d",min_num);
return 0;
}Select an option to see the answer and solution.
Q518
Open questionLet G=(V, E) while (V > 2) pick any edge e from E randomly __________________________ remove self-loops return the cut left with last 2 vertices
Select an option to see the answer and solution.
Q519
Open questionSelect an option to see the answer and solution.
Q520
Open questionSelect an option to see the answer and solution.