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

Give the advantage of linked lists over the packed array structure. and the disa

ID: 3683993 • Letter: G

Question

Give the advantage of linked lists over the packed array structure. and the disadvantage For a singly linked list, indicate which of the below operations are fast (not proportional to n, the number of nodes) or slow (proportional to the number of nodes): insert delete fetch, update If the singly linked list is changed to a sorted singly linked list, which of the operation in question 2 are sped up and when is this speed advantage realized ? P and O are reference variables. Give the code to insert the node O points to after the node P points to. Assume the nodes' pointer reference variable is called: next. Now give the code to delete the node inserted above from the list, and return the storage allocated to node back to the Java memory manager

Explanation / Answer

1.a)Advantages of using Linked Lists over packed array structure :

1.b)Disadvantages of Linked Lists over packed array structure :

2.a) temp.next = ptr.next, then ptr.next=temp

b) ptr.next = ptr.next.next

c)

struct node *n;

int c=0;

n=head;

while(n!=NULL){

n=n->next;

c++;}

return c;

d)

display(struct node *r){

r=head;

if(r==NULL){

return;}

while(r!=NULL)

    printf(" ");}

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