Linked List – Arithmetic – Problem #5
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Difficulty: medium
Problem Statement
Define a structure “node” to store a link list of integers. Write a function void make_list(node *l, int n) to read n integers and store them in a link list. Write a function int min_list(node *l) which takes as input a link list and returns the value of the smallest element of the link list. Write a main program to – Read an integer n. Then uses make_list function to read n integers and stores them in a list l. Call min_list function compute and then print the smallest element of list l. Example: Input: 1, 2, 3, 4, 5 Output: 1