16void print(
node *head) {
18 while (current != NULL) {
19 cout << current->data <<
" ";
20 current = current->link;
26node *createlist(
int n) {
29 for (
int i = 0; i < n; i++) {
47void my_selection_sort_linked_list(
node *&head) {
76 while (current != NULL)
80 if (current->data < min->data)
93 min->link = current->link;
94 current->link = previous;
96 current = previous->link;
103 previous->link = current->link;
106 current = previous->link;
111 temp->link = current;
112 previous->link = current->link;
115 current = previous->link;
120 previous = previous->link;
121 current = current->link;
160 cout <<
"enter the no. of nodes : ";
165 head = createlist(n);
166 cout <<
"original list is : ";
168 my_selection_sort_linked_list(head);
169 cout <<
"sorted list is : ";
struct node { int data; int height; struct node *left; struct node *right;} node
for std::queue
struct list * link
pointer to nodes