EC Lecture Notes - Lecture 12: Linked List, C Dynamic Memory Allocation, Scanf Format String

6 views12 pages

Document Summary

Singly circular linked list search , count nodes , reverse, sort ,maximum, minimum , update. //current will point to head struct node *current = last->next, *index = null; int temp; if (last->next == null) printf("list is empty"); else do. //index will point to node next to current index = current->next; while (index != last->next) //if current node is greater than index data, swaps the data if (current->info > index->info) temp = current->info; current->info = index->info; index->info = temp; index = index->next; current = current->next; // check list is empty if (last->next== null) { return; // initialize head to current pointer current = last->next; // initialize min int value to max int min = int_max, max = int_min; // while last node is not reached do { // if current node data is lesser for min. // then replace it if (current->info < min) { min = current->info; singly circular linked list2. // if current node data is greater for max.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers