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 }); }
Linear Search applied to Linked List
In Linked List linear searching is nothing but finding a node with the given information for the presence. If it is present search is successful otherwise unsuccessful. Linked List supports only linear search. The main reason behind this is the inability of reaching any of the nodes directly except the first node. Only the address of the first node is always available in an external pointer. With the help of the first node only it is possible to reach the second node. Without the address of previous node one can not reach the next node. The next node’s address is always stored in previous node. Although the order of the information may in either ascending or descending but accessibility of the elements is not direct, so application of linear is only possible in case of linked list. Searching (of course linear) almost resembles traversing except that if search is successful traversing is terminated otherwise the linked list is traversed till the end.
So, in order to do linear searching, get the information to be searching and set PTR with ROOT. Compare Information with INFO of PTR, if it is equal ‘search is successful’ and terminate traversing otherwise update PTR with LINK of PTR and repeat the process. Continue the operation till the end. The end is recognized by a NULL assigned to PTR.
Comments
Post a Comment