Hello, I really need help writing a function that sorts

 Hello, I really need help writing a function that sorts a Linked List using SHELL SORT. It MUST BE SHELL SORTED. PLEASE WRITE IN C. ONLY C. NO OTHER LANGUAGE. This function is part of a larger project, and I am struggling to write it. I know how to shell sort an array, but I am having trouble doing the same with a linkedlist.

 

This is the function:

 

typedef struct _Node {
 long value;
 struct _Node *next;
 } Node;

 

Node *List_Shellsort(Node *list, double *n_comp)

 

{

 

}

 

*list is the list of nodes that need to be sorted. *list is already full of values (the size of the list varies). ALL THE VALUES IN *list ARE LONG INTS. *n_comp is the number of comparisons made during the shell sorting process. A comparison here is defined to be any comparison that involves the field value in the structure Node. This variable will be assigned a value during the sorting. It is currently zero. I am using a particular gap sequence for this sorting (1,2,3,4,6,9…. this is Pratt’s gap sequence). I have already created another function that generates this sequence. You may use your own gap sequence to write this function if that is convenient. 

 

Stressed over that homework?

Essay deadline breathing down your neck?

Let’s cut to the chase: Why struggle when you can ace it with zero hassle?

Whether it’s essays, research papers, or assignments — we’ve got you covered.

✅ Expert writers
✅ 100% original work
✅ No AI tools, just real pros

Stressed about your essay or homework? Get a top-quality custom essay NOW!!! Stop worrying. Start succeeding.

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top