Question: - A swap function that exchanges the position of two nodes in the doubley linked list but it does not exchange the values for implementing
- A swap function that exchanges the position of two nodes in the doubley linked list but it does not exchange the values for implementing swap, I am not to sure how to do. in C
/*! * \brief swap Swap position of two nodes with each other within one list * \param ref1 A node from list * \param ref2 A node from list */ void swap(struct node* ref1, struct node* ref2) {
/* * Nodes could be far from each other * Nodes could be next to each other ref2 after ref1 * Nodes could be next to each other ref1 after ref2 */
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
