Array is preferred over linked list for the implementation of ________
Answer: C
When we try to implement binary search using linked list, the traversal steps per element increases in order to find the middle element. Thus, this process is slow and inefficient. This process is much faster using an array, hence it is preferable to use an array for the implementation of binary search.
Enter details here
What will be the output of the following C code?
#include
typedef struct student
{
char *a;
}stu;
void main()
{
struct stu s;
s.a = "hi";
printf("%s", s.a);
}
Answer: A
No answer description available for this question.
Enter details here
Which of the following is false about typedef?
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
typedef int integer;
int main()
{
int i = 10, *ptr;
float f = 20;
integer j = i;
ptr = &j;
printf("%d\n", *ptr);
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
typedef struct error {int warning, err, exception;} ERROR;
int main()
{
ERROR e;
e.err=1;
printf("%d\n", e.err);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
Which of the given option is the correct method for initialization?
typedef char *string;
Answer: B
No answer description available for this question.
Enter details here
Consider this statement: typedef enum good {a, b, c} hello; Which of the following statements is incorrect about hello?
Answer: A
The keyword typedef is used to give an alternate name to an existing data type. Hence hello is the new name for enum good.
Enter details here
typedef which of the following may create problem in the program?
Answer: D
No answer description available for this question.
Enter details here
The advantage of using linked lists over arrays is that ________
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
typedef struct p
{
int x, y;
};
int main()
{
p k1 = {1, 2};
printf("%d\n", k1.x);
}
Answer: A
No answer description available for this question.
Enter details here