Question
1- What does the following code fragment do? vector my_vector; my_vector.push_back(3.456); my_vector.push_back(5); double result = my_vector[1] + my_vector[0]; cout < < Result is <
1- What does the following code fragment do?
vector
my_vector.push_back(3.456);
my_vector.push_back(5);
double result = my_vector[1] + my_vector[0];
cout << "Result is " << result;
2. What is the difference between a shallow copy and a deep copy?
3. Why is it not a problem to have a shallow copy of a primitive-type data
field?
4-
Answer the following questions about lists.
a. Each node in a single-linked list has a pointer to _________________________.
b. In a double-linked list each node has a pointer to________________, and __________.
c. To remove an item from a single-linked list you need a pointer to________________.
d. To remove an item from a double-linked list you need a pointer to ________________.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started