JavaScript isn't enabled in your browser, so this file can't be opened. Enable and reload.
PROG 2 REVIEWER FOR FINALS
^-^
Sign in to Google
to save your progress.
Learn more
* Indicates required question
Which among the statements below is/are true?
*
2 points
An array list requires a form of special marking which caused the linear cost to inserting and deleting elements.
Deleting the first element in the linked list is done in constant time.
A linked list has a fixed size memory allocation for each element.
Required
Which among the statements below are true about fwrite()?
*
2 points
The value returned by fwrite() will be greater than or equal to the value in its third parameter.
Using fwrite() would require any of "w", "wb", "w+" or "w+b" in its parameter list to make a legal function call.
The fwrite() function always requires the address of variable containing the data to be written to the file.
Required
Which of these statements about linked list is false?
*
2 points
Elements are stored at contiguous memory locations.
Linked list pointer variable is stored in the execution stack, and not in the heap memory.
Nodes in the linked list are dynamically allocated and deallocated.
Elements in the array list are accessed sequentially.
Random access of elements cannot be performed in a linked list.
A self-referenced structure is always necessary in a linked list.
Which of the following is true?
*
2 points
Compiler error in the declaration and initialization.
Compiler error in the data structure definition.
Runtime error in the declaration and initialization.
No compiler and runtime error.
Which of these statements about array implementation of ADT list is true?
*
2 points
Elements in the array list are accessed sequentially but not randomly.
Random access of elements cannot be performed in the array list.
Elements are not stored in contiguous memory locations.
The memory allocation for an empty list is the same as a non-empty list.
The physical order of elements is not the same as the logical order of the elements.
The number of elements that can be stored in the list is infinite.
Which of these statements is true about linked list and array list?
*
2 points
The time to update the first element of the list is the same for linked list and array list.
The time to add an element at the end list is the same for linked list and array list.
The time to delete the first element of the array list is shorter compared to linked list.
Array list and linked list can be accessed sequentially and randomly.
Elements for array list and linked list are stored in contiguous memory locations.
What is the output of the following code snippet?
*
2 points
Compiler Error, arr is not a string
5baZC2sp
Runtime Error
Displays garbage values
ZC2sp
Given the code snippet and after running the code, what is the output?
*
2 points
4
3
2
Compilation Error
Pointer Arithmetic Error
Given the code snippet, which of the following statement/s is/are correct to copy all the contents of Science to Bio?
*
2 points
memcpy(&Bio, &Science, sizeof(Bio));
Bio = Science;
Science = Bio;
memcpy(&Science, &Bio, sizeof(Science));
Required
Given the code snippet, which of the following statement/s is/are syntactically incorrect?
*
2 points
e = d;
c = e[2];
*d = c;
Required
What is the output of the following code snippet?
*
2 points
0.0
3.0
Displays Garbage Value
4.0
Compiler Error
What is the output of the following code snippet?
*
2 points
Displays Garbage Value
0
4
Compilation Error
Runtime Error
3
Given the code snippet, which of the following will output the size of the union rubbish?
*
2 points
sizeof(TRASH)
sizeof(RUBBISH_BIN)
sizeof(BOTTLE)
Required
Given the code snippet, which of the following statement(s) is(are) correct to copy all the contents of Bio to Science?
*
2 points
Science = Bio;
memcpy(Science, Bio, sizeof(Science));
memcpy(Bio, Science, sizeof(Bio));
Bio = Science;
Required
Given the code snippet, which of the following is true about the code snippet?
*
2 points
free(a) is a runtime error because heap memory was created through c
Memory leak or garbage in the heap is created when c is made to point to b
None of the choices
free(c) will free the dynamically allocated space
sizeof(c) > sizeof(b)
Given the code snippet, which of the following will correctly display the price?
*
2 points
printf("%.2f", *bars.price);
printf("%.2f", bars[0].price);
printf("%.2f", bars->price);
Required
Next
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. -
Terms of Service
-
Privacy Policy
Does this form look suspicious?
Report
Forms
Help and feedback
Contact form owner
Help Forms improve
Report