51.
What is the output of the following code?
#include<stdio.h>
#include<stdlib.h>
struct Node
{
     int val;
     struct Node* next;
}*head;
int get_max()
{
      struct Node* temp = head->next;
	  int max_num = temp->val;
	  while(temp != 0)
	  {
	        if(temp->val > max_num)
		    max_num = temp->val;
		temp = temp->next;
	  }
	  return max_num;
}
int get_min()
{
      struct Node* temp = head->next;
	  int min_num = temp->val;
	  while(temp != 0)
	  {
	        if(temp->val < min_num)
		    min_num = temp->val;
		temp = temp->next;
	  }
	  return min_num;
}
int main()
{
      int i, n = 9, arr[9] ={8,3,3,4,5,2,5,6,7};
      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 max_num = get_max();
      int min_num = get_min();
      printf("%d %d",max_num,min_num);
      return 0;
}

54.
What is the output of the following code?
void my_recursive_function(int n)
{
    if(n == 0)
    return;
    printf("%d ",n);
    my_recursive_function(n-1);
}
int main()
{
    my_recursive_function(10);
    return 0;
}

57.
What will be the time complexity of the given code?
#include <stdio.h> 
#include <string.h> 
#include <iostream.h>
using namespace std;
void swap(char *x, char *y) 
{ 
	char temp; 
	temp = *x; 
	*x = *y; 
	*y = temp; 
} 
 
void func(char *a, int l, int r) 
{ 
int i; 
if (l == r) 
	cout<<a<<” ,”; 
else
{ 
	for (i = l; i <= r; i++) 
	{ 
		swap((a+l), (a+i)); 
		func(a, l+1, r); 
		swap((a+l), (a+i)); 
	} 
} 
} 
 
int main() 
{ 
	char str[] = "AB"; 
	int n = strlen(str); 
	func(str, 0, n-1); 
	return 0; 
}

60.
Given below is the pseudocode of floyd's cycle detection algorithm. Which of the following best suits the blank?
Start traversing the linked list using two pointers
move one pointer with . . . . . . . .
if pointers meet at any node
{
    loop exists in the linked list 
}
else 
{
    linked list doesn’t have a loop
}