Question 11
Question 12
Question 13
Question 14
Question 15
Job | Deadline | Profit |
---|---|---|
a | 2 | 37 |
b | 3 | 50 |
c | 1 | 37 |
d | 4 | 60 |
e | 3 | 50 |
f | 2 | 80 |
Question 16
Question 17
19, 23, 40, 32, 91, 25, 100, 36Sort this list in increasing order using insertion sort and determine the number of passes, comparisons, and swaps. Here a pass means iteration of main loop. We may assume that we start checking from first element which is 19 here. Note - This question is multiple select questions (MSQ).
Question 18
#include <stdio.h>
#include <string.h>
struct s {
int i;
char *c;
} str[] = {100, \"eclasses\", 200, \"geeks\",300, \"data\",400,\"structure\",500,\"students\"};
int main()
{
struct s *p = str;
p += 1;
printf(\"%s\", p -> c);
p--;
printf(\"%s,\", ++p -> c);
printf(\" %d, \", p[1].i);
p=p+4;
printf(\"%s\", p -> c);
}
Question 19
#include<stdio.h>
#include<string.h>
int main()
{
char *s1[]={\"Dubai\",\"Singapore\",\"Paris\",\"Sanghai\",\"HongKong\"};
char **s2[]={(s1+2),(s1+1),(s1+3),(s1+4),(s1+0)};
char ***s3=s2;
char str1[]=\"I love to visit \";
char str2[]=\"times every year.\";
s3++;
printf(\"%s\",str1);
printf(\"%s \",**++s3);
printf(\"%d-%d \",s3-s2,*s3-s1);
printf(\"%s\",str2);
return 0;
}
Question 20
There are 55 questions to complete.