Icollections app10/30/2023 ![]() On the one hand, it is a good feature whenever developers are not sure about size of arraylist and on the other hand, it might take a long time for size definition. List is NOT Fixed Length -> It is possible that data grows.By Dequeue method you can remove item from the BEGINNING of the Queue -> // First in First out FIFO =objQueue.Dequeue().ToString() It is NOT strongly typed and NOT fixed size. ![]() As you got it, item that comes last will be selected to POP for first one and its expression in computer science is equal to "Last in First out" = "LIFO". Therefore whenever you want to insert item, you should add (PUSH) it at the top of the stack and whenever you want to remove (POP) item from stack, you should remove it from top of the stack. So stack put later item on the top of items and this behavior is "defining priority for each item". Stack defines priority for each item, it means stack behavior forces its items to put (push) inside stack prioritized form. Stack is a prioritized data structure (such as List is indexed base). We have different data structure and stack is one of them. * finding item is easier you just need to point to it by call its key Sized=10? 20? 100? ->NOT Fixed Size // Namespace: System.Collections // Hashtable solve the problem in Arraylist when we are looking for specific item // Hashtable dedicate a key for each item, then finding item is easier and faster string? int? object? decimal? OR OBJECT? -> NOT Strongly Type // 2. It is NOT obvious that strArrayList is // 1. Therefore finding data is easy just by pointing out to its key. HashTable is another kind of data structure that defines key value for each data section. * Finding among Object of Array List is difficult, // you have to find your specific item by index ObjArrayList.Add( new Product( " 1003", " Carpet")) ObjArrayList.Add( new Product( " 1002", " Sofa")) ObjArrayList.Add( new Product( " 1001", " Chair")) Sized=10? 20? 100? ->NOT Fixed Size // Namespace: System.Collections Below is old way to fill obj from product, // in Arraylist you need to create more than one instance // Product objProduct = new Product() // objProduct.Code = "1001" // objProduct.Name = "Chair" // It is NOT obvious that strArrayList is // 1. StrArrayList.Add( " Mahsa") // "Mahsa": is string type of data is not specific runtime deferred support string? int? object? decimal? -> NOT Strongly Type // 2. It is NOT obvious that strArrayList is 1.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |