Using Dyanmic LL write a C++ program to do the following: Create a Dynamic LL Add anode: a) When the List is empty b) In the beginning of the List c) In the end of the List d) Somewhere between the beginning and the end of the List. e) Purge the LL The ADD algorithm is to determine where the new node to be placed in the List. The user is not be asked where the new node should be inserted. Delete a node: a) When the List is empty b) From the beginning of the List c) From the end of the List d) From somewhere between the beginning and the end of the List. The DELTE algorithm is to determine where the targeted node is placed in the List. The user is not be asked about the location of the targeted node. Search for a node and display its contents. The Search is done based on a key field from the node (i.e a name, or an ID) The Search algorithm is to locate the targeted node and to display it The user is not be asked about the location of the targeted node. Modify a node. The user is to enter on a key field from the node (i.e a name, or an ID) The Search algorithm is to search for the targeted node from the beginning of the List. Display the node before and after modification. Display the Entire Linked List. The display function is to display the list from the front to end
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).
Using Dyanmic LL write a C++ program to do the following:
Create a Dynamic LL
Add anode:
a) When the List is empty
b) In the beginning of the List
c) In the end of the List
d) Somewhere between the beginning and the end of the List.
e) Purge the LL
The ADD
The user is not be asked where the new node should be inserted.
Delete a node:
a) When the List is empty
b) From the beginning of the List
c) From the end of the List
d) From somewhere between the beginning and the end of the List.
The DELTE algorithm is to determine where the targeted node is placed in the List.
The user is not be asked about the location of the targeted node.
- Search for a node and display its contents.
The Search is done based on a key field from the node (i.e a name, or an ID)
The Search algorithm is to locate the targeted node and to display it
The user is not be asked about the location of the targeted node.
- Modify a node.
The user is to enter on a key field from the node (i.e a name, or an ID)
The Search algorithm is to search for the targeted node from the beginning of the List.
Display the node before and after modification.
- Display the Entire Linked List.
The display function is to display the list from the front to end
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images