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 }); }
Understanding creation of doubly linked list:
One node with information ‘6’ is added to the doubly linked list. Then the list become,
Another node with information ‘16’ is added to the circular linked list. Then the list become,
Similarly when two more nodes are added with information ‘1’ and ’61’, the list become,
Traversing the Doubly Linked List
Set a pointer variable PTR with ROOT. Process PTR-->INFO and update PTR by LINK of PTR i.e. PTR<--PTR-->LINK. Repeat till the PTR is NULL. The algorithm is as follows:
TRAVERSDLL (ROOT)
PTR<--ROOT
Repeat While PTR< >NULL
Apply process to PTR-->INFO
PTR<--PTR-->LINK
[End of while]
Exit
Algorithm to print the contents of a linked list:
TRAVERSEDLL (ROOT)
PTR<--ROOT
Repeat While PTR< >NULL
Write: PTR-->INFO; PTR<--PTR-->LINK
[End of while]
Exit.
From the just created doubly list in the example shown it is possible to traverse the doubly linked list in reverse order starting from the last node. Address of the last node is available in external pointer TEMP. Set a pointer variable PTR with TEMP. Process PTR-->INFO and update PTR by storing the address of previous node given by the pointer part PREV of PTR i.e. PTR<--PTR-->PREV. Repeat till the PTR is NULL.
The algorithm is as follows:
TRAVERSEDLLRO
PTR<--TEMP
Repeat While PTR< >NULL
Apply process to PTR-->INFO; PTR<--PTR-->PREV
[End of while]
Exit.
Rests of the operations are similar to singly linked list and are left out as exercises.
Another node with information ‘16’ is added to the circular linked list. Then the list become,
Similarly when two more nodes are added with information ‘1’ and ’61’, the list become,
Traversing the Doubly Linked List
Set a pointer variable PTR with ROOT. Process PTR-->INFO and update PTR by LINK of PTR i.e. PTR<--PTR-->LINK. Repeat till the PTR is NULL. The algorithm is as follows:
TRAVERSDLL (ROOT)
PTR<--ROOT
Repeat While PTR< >NULL
Apply process to PTR-->INFO
PTR<--PTR-->LINK
[End of while]
Exit
Algorithm to print the contents of a linked list:
TRAVERSEDLL (ROOT)
PTR<--ROOT
Repeat While PTR< >NULL
Write: PTR-->INFO; PTR<--PTR-->LINK
[End of while]
Exit.
From the just created doubly list in the example shown it is possible to traverse the doubly linked list in reverse order starting from the last node. Address of the last node is available in external pointer TEMP. Set a pointer variable PTR with TEMP. Process PTR-->INFO and update PTR by storing the address of previous node given by the pointer part PREV of PTR i.e. PTR<--PTR-->PREV. Repeat till the PTR is NULL.
The algorithm is as follows:
TRAVERSEDLLRO
PTR<--TEMP
Repeat While PTR< >NULL
Apply process to PTR-->INFO; PTR<--PTR-->PREV
[End of while]
Exit.
Rests of the operations are similar to singly linked list and are left out as exercises.
Comments
Post a Comment