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 }); }
Circular Linked List
A little variation applied to linear linked list gives another type of linked list called as circular linked list. You might have observed in the linear linked list that the last node always points to the invalid address such as NULL address. Practically speaking the memory is wasted. Instead of NULL address if we think to keep the valid address in that field such as the address of the first node available in external pointer ROOT, then the linear linked list becomes circular linked list. As the last point in the circular linked list always points to the first node this type of linked list carries the name circular. The implementation is straightforward.
Whenever you create the circular linked list always assign the pointer field of the newly added node with the first node address given by ROOT(external pointer).
Algorithm to create a circular linked list:
CREATECLL
ROOT<--NULL; CHOICE<--‘Y’
Repeat While CHOICE=’Y’
If AVAIL=NULL Then:
Write: ’Memory Allocation Error’
Exit.
Else:
NEW<--AVAIL
NEW-->INFO<--Information
AVAIL<--AVAIL-->LINK
[End of if]
If ROOT=NULL Then:
ROOT<--NEW; TEMP<--NEW
Else:
TEMP-->LINK<--NEW; TEMP<--NEW
[End of If]
NEW-->LINK<--ROOT
Write: ‘Do you want to add another node?(Y/N)’
Read: CHOICE
[End of while]
Exit.
A little variation applied to linear linked list gives another type of linked list called as circular linked list. You might have observed in the linear linked list that the last node always points to the invalid address such as NULL address. Practically speaking the memory is wasted. Instead of NULL address if we think to keep the valid address in that field such as the address of the first node available in external pointer ROOT, then the linear linked list becomes circular linked list. As the last point in the circular linked list always points to the first node this type of linked list carries the name circular. The implementation is straightforward.
Whenever you create the circular linked list always assign the pointer field of the newly added node with the first node address given by ROOT(external pointer).
Algorithm to create a circular linked list:
CREATECLL
ROOT<--NULL; CHOICE<--‘Y’
Repeat While CHOICE=’Y’
If AVAIL=NULL Then:
Write: ’Memory Allocation Error’
Exit.
Else:
NEW<--AVAIL
NEW-->INFO<--Information
AVAIL<--AVAIL-->LINK
[End of if]
If ROOT=NULL Then:
ROOT<--NEW; TEMP<--NEW
Else:
TEMP-->LINK<--NEW; TEMP<--NEW
[End of If]
NEW-->LINK<--ROOT
Write: ‘Do you want to add another node?(Y/N)’
Read: CHOICE
[End of while]
Exit.
Comments
Post a Comment