I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
Deletion
Removing a node from the linked list is called deletion. Get the Information of the node, which is to be removed. Compare the Information with the INFO of ROOT . If it is equal update ROOT with LINK of ROOT, otherwise set pervious location PLOC with ROOT and location LOC with LINK of ROOT. Compare the information with that of INFO of LOC, if it is not equal then copy LOC in PLOC and update LOC with LINK of LOC. If the node is found then come out and set LINK of PLOC with LINK of LOC, and the deletion is over. Add the deleted node to Free Pool, by assigning LINK of LOC with AVAIL and AVAIL with LOC.
If the PLOC is assigned with LOC, then when the list is traversed automatically the node with address LOC is skipped, that is why PLOC is used in this case.
For example consider the below linked list:
If a node with information 20 is to be deleted, the operation is done as shown below:
The original list after deletion of the node with information 20 is shown e:
Algorithm to delete a node from the Linked List:
DELETIONLL(ROOT, INFO)
If INFO=ROOT-->INFO Then:
LOC<--ROOT
ROOT<--ROOT-->LINK
Else:
PLOC<--ROOT
LOC<--ROOT-->LINK
Repeat While LOC< >NULL AND INFO< >LOC-->INFO
PLOC<--LOC
LOC<--LOC-->LINK
[End of While]
PLOC--> LINK<-- LOC-->LINK
[End of If]
[Following statements to add deleted node to free pool]
LOC-->LINK<--AVAIL
AVAIL<--LOC
Exit.
Removing a node from the linked list is called deletion. Get the Information of the node, which is to be removed. Compare the Information with the INFO of ROOT . If it is equal update ROOT with LINK of ROOT, otherwise set pervious location PLOC with ROOT and location LOC with LINK of ROOT. Compare the information with that of INFO of LOC, if it is not equal then copy LOC in PLOC and update LOC with LINK of LOC. If the node is found then come out and set LINK of PLOC with LINK of LOC, and the deletion is over. Add the deleted node to Free Pool, by assigning LINK of LOC with AVAIL and AVAIL with LOC.
If the PLOC is assigned with LOC, then when the list is traversed automatically the node with address LOC is skipped, that is why PLOC is used in this case.
For example consider the below linked list:
If a node with information 20 is to be deleted, the operation is done as shown below:
The original list after deletion of the node with information 20 is shown e:
Algorithm to delete a node from the Linked List:
DELETIONLL(ROOT, INFO)
If INFO=ROOT-->INFO Then:
LOC<--ROOT
ROOT<--ROOT-->LINK
Else:
PLOC<--ROOT
LOC<--ROOT-->LINK
Repeat While LOC< >NULL AND INFO< >LOC-->INFO
PLOC<--LOC
LOC<--LOC-->LINK
[End of While]
PLOC--> LINK<-- LOC-->LINK
[End of If]
[Following statements to add deleted node to free pool]
LOC-->LINK<--AVAIL
AVAIL<--LOC
Exit.
Yperfnaarne Adam Leon click
ReplyDeletevieducheasign