QUESTION 6
1. Why are strings usually primitive (or
near-primitive) in modern programming languages?
readability
readability and writeability
efficiency
readability, writeability, and
efficiency
QUESTION 7
1. There are two main problems with pointers:
dangling pointers & memory
leaks
marked sweep and memory leaks
dangling pointers &
tombstones
reference counters and marked
sweep
QUESTION 8
1. Which of the following implementations of arrays can
grow?
static
heap-dynamic
fixed heap-dynamic
fixed stack-dynamic
QUESTION 9
1. Why are arrays with homogenous elements so
efficient?
direct access
indirect access
can use linked lists to
implement
uses a table to implement the index
lookup
QUESTION 10
1. Which of the following is NOT a string length
option?
fixed length
dynamic length (based on
type)
dynamic length (based on
implementation)
dynamic length (no size
limit)
Answer 6
readability, writeability, and efficiency
String improves readalility and writability eg, 300 is integer and "300" is the string value
As we know that operstions on primitives are supported by computer hardware thus increases efficiency
Answer 7
dangling pointers & memory
leaks
Dangling pointer is the pointer that points to object that doesn't
exist in memory location
Memory leak occur when allocated memory is not deallocated
Answer 8
heap-dynamic
in this type of array the size can grow dynamically as and when required
Answer 9
direct access
Homogeneous arrays can easily delete or retreive any element based on the index
Answer 10
dynamic length (based on
type)
based on implementation means the dynamic length set by variable
definition
dynamic length (no size limit) means it can grow and shrink dynamically
Get Answers For Free
Most questions answered within 1 hours.