Write an algorithm for array implementation of List ADT.

Algorithm for solving above problem:

Step 1: Start
Step 2: Create an empty list using structure that includes data and position of a Node
Step 3: Set the maximum size for the list and initialize position to O.
Step 4: Get the choice from the user
a. Insertion
b. Deletion
c. Traversal ( Display)
d. Exit
Step 5: Get the choice from the user.
Step 5.1: If choice = insertion,
Check if node position = maximum size, Display" List Overflow" 
Otherwise store the data into the list and increment the position by one.
Step 5.2: If choice = deletion
Delete the data from the list and decrement the position by one.
Step 5.3: If choice = display
Display the stored data from the list
Step 6: Stop

Mukesh Rajput
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:


Mukesh Rajput