Q1. Write a Python program using List Methods and Functions to do the following • Create an empty list with the name num • Add the elements (5,7,2) to the list • Insert the element 50 in the index 2 • Sort the list in descending order Display the sum of the list elements Q2. Write a Python program using List Methods and Functions to do the following • Input n elements to the list L • Find the sum of all the list elements • Find the minimum value in the list • Check whether the value 10 is present in the list or not
Types of Linked List
A sequence of data elements connected through links is called a linked list (LL). The elements of a linked list are nodes containing data and a reference to the next node in the list. In a linked list, the elements are stored in a non-contiguous manner and the linear order in maintained by means of a pointer associated with each node in the list which is used to point to the subsequent node in the list.
Linked List
When a set of items is organized sequentially, it is termed as list. Linked list is a list whose order is given by links from one item to the next. It contains a link to the structure containing the next item so we can say that it is a completely different way to represent a list. In linked list, each structure of the list is known as node and it consists of two fields (one for containing the item and other one is for containing the next item address).
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images