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 }); }
The merging is over. The merged list can be traversed with the help of the external pointer ROOT. ROOT points to the node with information 1. Node with information 1 points to the node with information 10. Next node is the node with information 20. Similarly the nodes with information 23 and 25 are the next node. The node with information 25 is the last node of the merged list.
Algorithm to merge two ordered linked lists:
MERGEOLLS(ROOT1,ROOT2)
IfROOT-->INFO<ROOT2-->INFO Then:
ROOT<--ROOT1; ROOT1<--ROOT1-->LINK
Else:
ROOT<--ROOT2; ROOT2<--ROOT2-->LINK
[End of If]
PTR<--ROOT
Repeat While ROOT1< >NULL AND ROOT2< >NULL
If ROOT1-->INFO<ROOT2-->INFO Then:
PTR-->LINK<--ROOT1
PTR<--PTR-->LINK
Else:
PTR-->LINK<--ROOT2
PTR<--PTR-->LINK
ROOT2<--ROOT2-->LINK
[End of If]
[End of While]
If ROOT1 = NULL Then:
PTR<--ROOT2
[End of If]
If ROOT2 = NULL Then:
PTR<--ROOT1
[End of If]
Exit.
Algorithm to merge two ordered linked lists:
MERGEOLLS(ROOT1,ROOT2)
IfROOT-->INFO<ROOT2-->INFO Then:
ROOT<--ROOT1; ROOT1<--ROOT1-->LINK
Else:
ROOT<--ROOT2; ROOT2<--ROOT2-->LINK
[End of If]
PTR<--ROOT
Repeat While ROOT1< >NULL AND ROOT2< >NULL
If ROOT1-->INFO<ROOT2-->INFO Then:
PTR-->LINK<--ROOT1
PTR<--PTR-->LINK
Else:
PTR-->LINK<--ROOT2
PTR<--PTR-->LINK
ROOT2<--ROOT2-->LINK
[End of If]
[End of While]
If ROOT1 = NULL Then:
PTR<--ROOT2
[End of If]
If ROOT2 = NULL Then:
PTR<--ROOT1
[End of If]
Exit.
Comments
Post a Comment