[Solved] Describe the algorithm to swap two adjacent elements by adjusting only the links (and not the data) using: a, singling link list b, doubling link list

Describe the algorithm to swap two adjacent elements by adjusting only the links (and not the data) using: a, singling link list b, doubling link list solved Describe the algorithm to swap two adjacent elements by adjusting only the links (and not the data) using: a, singling link list b, doubling link list

[Solved] *head’ is a pointer; did you mean to use ‘->’? Why am I getting this

On this line: *head->prev=temp; The -> operator has higher precedence than the * operator, so it parses as: *(head->prev)=temp; This is invalid because head is a pointer-to-pointer-to-struct, not a pointer-to-struct. You need to add parenthesis to force the * operator to apply directly to head: (*head)->prev=temp; Also, don’t cast the return value of malloc as … Read more