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 }); }
Elementary sorting:
As we have seen in the case of binary search that it is necessary to arrange the elements of the array in a particular order either in ascending or in descending order. So if the elements of the array are arranged in either ascending or descending order then such array is called as sorted array. The operation necessary to apply on the array to arrange the elements of the same in order is called as sorting. If the array elements are not stored order then we apply sorting operation to sort the array elements. the elementary sorting techniques that are used are Selection sort, Insertion sort, and bubble sort. Basically the sorting operation is applied to sort the elements in ascending order. Let us study the techniques to sort the elements of one-dimensional array in ascending order.
Selection sort:
In this technique of sorting, the fact of selecting the minimum element from n (size of the array) number of elements is used. The selected minimum element is interchanged with the first element of the array. Then leaving the first element, the minimum element is again picked from the remaining n-1 elements and interchanged with the second element. The same process of selecting minimum element and interchanging it from the respective element is repeated to obtain the sorted array. In total n-1 passes are applied to obtain the sorted array. As we select the minimum element in every pass this technique of sorting the elements is called as Selection sort.
Comments
Post a Comment