Questions 101–110 of 534. Imported answers require independent review unless marked reviewed.

Topic practice 534 questionsPage 11 of 54

Question 19

Open question
CSMCQ1 markNeeds review
Consider the following C program:
#include <stdio.h>
void strcpy(char *, char *);
int main(){
char a[30] = "@#Hello World!";
strcpy(a, a + 2);
printf("%s\n", a);
return 0;
}
void strcpy(char *s, char *t) {
while(*t)
*s++ = *t++;
}
Which ONE of the following will be the output of the program?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 20

Open question
CSMCQ1 markNeeds review
Consider the following recurrence relation:

for

Which ONE of the following options is CORRECT?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 20

Open question
CSMCQ1 markNeeds review
Consider an unordered list of

distinct integers.
What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 21

Open question
CSMCQ1 markNeeds review
Consider the following statements about the use of backpatching in a compiler for intermediate code generation:
(I) Backpatching can be used to generate code for Boolean expression in one pass.
(II) Backpatching can be used to generate code for flow-of-control statements in one pass.
Which ONE of the following options is CORRECT?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 22

Open question
CSMCQ1 markNeeds review
Given the following syntax directed translation rules:
Rule 1:

Rule 2:

Rule 3:

Which ONE is the CORRECT option among the following?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 23

Open question
CSMCQ1 markNeeds review
Consider a network that uses Ethernet and IPv4. Assume that IPv4 headers do not use any options field. Each Ethernet frame can carry a maximum of 1500 bytes in its data field. A UDP segment is transmitted. The payload (data) in the UDP segment is 7488 bytes.
Which ONE of the following choices has the CORRECT total number of fragments transmitted and the size of the last fragment including IPv4 header?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 24

Open question
CSMCQ1 markNeeds review
Which ONE of the following languages is accepted by a deterministic pushdown automaton?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 25

Open question
CSMCQ1 markNeeds review
Let

be Context Free Grammars (CFGs) and

be a regular expression. For a grammar

, let

denote the language generated by

.
Which ONE among the following questions is decidable?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 26

Open question
CSMCQ1 markNeeds review
Processes

arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times.
Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 36

Open question
CSMCQ2 marksNeeds review
Consider a memory system with 1M bytes of main memory and 16K bytes of cache memory. Assume that the processor generates 20-bit memory address, and the cache block size is 16 bytes. If the cache uses direct mapping, how many bits will be required to store all the tag values? [Assume memory is byte addressable, 1K=2^, 1M=2^.]
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer