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 }); }
Searching:
In order to do searching in circular linked list, get the information to be searched and set PTR with ROOT. Compare Information with INFO of PTR, if it is equal ‘search is successful’ and terminate operation otherwise update PTR with LINK of PTR and repeat the process. Continue the operation till the end. The end is recognized by an address of first node given by ROOT stored in Link of PTR.
Algorithm for searching:
SEARCHCLL(ROOT, IN)
[ROOT is starting address of Linked List and
IN is Information to search in Linked List]
PTR<--ROOT
If PTR = NULL Then:
Write: ‘Empty Circular linked list’
Exit.
[End of If]
Repeat While IN< >PTR-->INFO
If PTR-->LINK = ROOT Then:
Break
[End of If]
PTR<--PTR-->LINK
[End of while]
If PTR-->INFO = IN Then:
Write: ‘Search Successful’
Else:
Write: ‘Search Unsuccessful’
[End of If]
Exit.
The insertion and deletion operations in circular linked list are similar to that of linear linked list and they are left as exercise. The hint is to only replace the end node checking condition of the linear linked list with that of circular linked list. This condition replacement you have learned in traversing and searching in circular linked list.
In order to do searching in circular linked list, get the information to be searched and set PTR with ROOT. Compare Information with INFO of PTR, if it is equal ‘search is successful’ and terminate operation otherwise update PTR with LINK of PTR and repeat the process. Continue the operation till the end. The end is recognized by an address of first node given by ROOT stored in Link of PTR.
Algorithm for searching:
SEARCHCLL(ROOT, IN)
[ROOT is starting address of Linked List and
IN is Information to search in Linked List]
PTR<--ROOT
If PTR = NULL Then:
Write: ‘Empty Circular linked list’
Exit.
[End of If]
Repeat While IN< >PTR-->INFO
If PTR-->LINK = ROOT Then:
Break
[End of If]
PTR<--PTR-->LINK
[End of while]
If PTR-->INFO = IN Then:
Write: ‘Search Successful’
Else:
Write: ‘Search Unsuccessful’
[End of If]
Exit.
The insertion and deletion operations in circular linked list are similar to that of linear linked list and they are left as exercise. The hint is to only replace the end node checking condition of the linear linked list with that of circular linked list. This condition replacement you have learned in traversing and searching in circular linked list.
Comments
Post a Comment