Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 13 Which segment of code inserts a new node (pointed to by pointer X) a

ID: 3865972 • Letter: Q

Question

Question 13 Which segment of code inserts a new node (pointed to by pointer X) at the beginning of a single linke list (as defhined in Q12)? The start pointer points to the beginning of the list. start-> next . X: X-start x-> next-start start-X->next; X-> next-start-, next: start-x; x->next-start, startX Question 14 5 pts Which segment of code inserts a new node (pointed to by pointer X) at any position Gie neither fhrst nor lbast) ofa single linked list? Assume prev pointer points to the previous position of the new node. O x- next- prev, prevnextX 0 X-,next-per-,next prev next-x. O Xx> next prev-next: prev next-X-» next Question 15 5 pts a binary tree contains m nodes at level L: it contains at most nodes at level L+1

Explanation / Answer

Hi,

Please find below the answer-

Ans 13 - X-->next=start; start=X-->next;
Ans 14 - X-->next=prev-->next; prev-->next=X;
Ans 15 - 2m
Ans 16 - n-1
Ans 17 - Front and Rear
Ans 18 - Delete the last element from the list
Ans 19 - X->bwd->fwd=X->fwd; X->fwd->bwd=X->bwd;
Ans 20 - for(ctr=1;X->fwd!=start;ctr++)X=X->fwd

Regards,

Vinay Singh

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote