Chat with us, powered by LiveChat C++ Question - Essayabode

C++ Question

1:Consider using bubble sort to process the following list of numbers into ascending order

(smallest to largest), where we make passes from the right (the end) back to the left

(beginning):

5 4 1 2 3

What would be the order of the numbers after making only the two passes through the list?

2:create a general-purpose Date class:

Date( int theMonth = 3, int theDay = 11, int theYear = 2022) { month = theMonth; day = theDay; year = theYear; }

how many different ways can we call the constructor How many [ 0 . . 5 ] of the options below would compile and run and call the constructor above?

I. Date aDate();

II. Date aDate = {5, 3, 2022};

III. Date aDate(5, 3, 2022);

IV. Date aDate(5);

V. Date aDate(5, 3);

3:Which of the following options is not an advantage an array has over a linked list? a) It uses less memory

b) Accessing an array entry is typically faster than accessing a list element

c) An element can be inserted in the middle without having to shift other elements

d) We can use memory arithmetic to jump to a particular part

4:Assume you have a Node class and pHead is a pointer to the head of the following list of Nodes:

class Node { public: int data; Node *pNext; };

11 9 7 5 3 1

What is the output from the statement? cout << pHead->pNext->pNext->pNext->data;

5:hat advantage does a linked list have over an array?

a) Linked lists take up less space in memory

b) We typically know the size of a linked list when the program is compiled

c) Traversing a linked list to find a value in a node is faster than finding a value in an array

d) It takes less computation time to insert a new node in the middle of a linked list than it does to insert a new value into the middle of an array.

6. Consider implementing a doubly linked list, such as the one below. Which two options below would be a benefit for such a list? For example, if you think the answer is E and F, put E and F.

look at the attached picture.

a) It is easier to traverse the list forwards and backwards

b) When removing a node, you only have to modify one of its pointers

c) You do not have to use recursion to reverse the list

d) When inserting a new node only pHead needs to be updated

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?