Which big guy helped me write the code, I just learned data structure, thank you

 Basic operations of singly linked list

 

This experiment requires the completion of the following operations:

 

(1)  First create and initialize a singly linked list;

 

(2)  Input a number of data, and store them in the singly linked list in turn, and output the storage state of the singly linked list after each new element is stored;

 

(3)  The length of the output singly linked list;

 

(4)  Traverse the singly linked list: output the storage state of the singly linked list;

 

(5)  Get elements: input the element order, and output the corresponding element value;

 

(6)  Find element: input the value of the element to be searched, and output its position sequence;


(7)  Insert element: input the position sequence and element value of the element to be inserted, and output the storage state of the singly linked list after the insertion process and the operation are completed;

 

(8)  Delete element: input the bit sequence of the element to be deleted, output the deletion process, the element value of the deleted element and the storage state of the singly linked list after the operation is completed.

 

(9)  Release the singly linked list

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324778764&siteId=291194637