Question
Here is the declaration for nodes in a singly-linked list of integers: write a function named that changes the location in a singly-linked list. The function prototype is Parameter head points to the and point to nodes in the linked list. You can assume that head and will never be NULL; your function does not have to check this. Here are some lest cases lo clarify what the function does. For each lest ease, assume head points for the linked list 10 20 30 40 50. points to the node containing 10 and dest points to the node containing 40. the function returns this linked list: 20 30 40 10 50. if 10_move points to the node containing 20 and dest points to the node containing 50. the function returns This linked list: 10 30 40 50 20. if points to the node containing 40 and dest points to the node containing 20, The function returns This linked list: 10 20 40 30 50. if points to the node containing 30 and dest contains NOLL, the function returns this linked list: 30 10 20 40 50. Your function is not permitted to call any of the linked list functions that were presented in class or that you developed in the labs. Your function is mil permitted to allocate new nodes or free nodes. Your function must be iterative (do not write a recursive function).
Explanation / Answer
int main() { int arr[20], n, i; printf("Enter the size of the array "); scanf("%d", &n); printf("Enter the elements to be sorted "); for(i = 0; i