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 }); }
To implement the STACK using Linked List, the following PUSH and POP algorithms may be used:
Algorithm for PUSH operation in Linked List implemented STACK:
PUSHLL(TOP, ITEM)
[TOP is address of top node of STACK and ITEM is the item to PUSH.[In case of Linked List no overflow, but may be memory allocation error]
If AVAIL=NULL then:
Write: ’Memory Allocation Error !!!’; Exit.
[End of If]
NEW<--AVAIL
AVAIL<--AVAIL-->LINK
NEW-->INFO<--ITEM
NEW-->LINK<--NULL
If TOP=NULL Then:
TOP<--NEW
Else:
NEW-->LINK<--TOP
TOP<--NEW
[End of If]
Exit.
For Linked List implemented STACK in C, a self-referential structure, a user defined data type STACK is used, it is as follows:
struct STACK
{
int i:
STACK *link:
};
Algorithm for POP operation in Linked List implemented STACK.
POPLL(TOP)
[TOP is the address of TOP node of STACK]
If TOP=NULL Then:
Write: ‘Underflow’
Exit.
[End of If]
ITEM <--TOP-->INFO
TOP<--TOP-->LINK
Return ITEM
Exit.
Algorithm for PUSH operation in Linked List implemented STACK:
PUSHLL(TOP, ITEM)
[TOP is address of top node of STACK and ITEM is the item to PUSH.[In case of Linked List no overflow, but may be memory allocation error]
If AVAIL=NULL then:
Write: ’Memory Allocation Error !!!’; Exit.
[End of If]
NEW<--AVAIL
AVAIL<--AVAIL-->LINK
NEW-->INFO<--ITEM
NEW-->LINK<--NULL
If TOP=NULL Then:
TOP<--NEW
Else:
NEW-->LINK<--TOP
TOP<--NEW
[End of If]
Exit.
For Linked List implemented STACK in C, a self-referential structure, a user defined data type STACK is used, it is as follows:
struct STACK
{
int i:
STACK *link:
};
Algorithm for POP operation in Linked List implemented STACK.
POPLL(TOP)
[TOP is the address of TOP node of STACK]
If TOP=NULL Then:
Write: ‘Underflow’
Exit.
[End of If]
ITEM <--TOP-->INFO
TOP<--TOP-->LINK
Return ITEM
Exit.
Comments
Post a Comment