with n elements is indexed from 0 to n-1. ★ An array has a fixed size. When creating an array, you specify the number of elements the array has. That’s it’s size. ★ Arrays are mutable. Meaning their state or data can be changed. @adoranwodo
we are getting more than one record, they will usually be returned as a JSON array. When we get the valid JSON array as a response, we can perform whatever action we want on the data. @adoranwodo API RESPONSES REAL LIFE USES OF ARRAYS /* The example below shows looping through a valid API response and printing out the data */ var response = GetAllPendingTransactions(); foreach (var transaction in response) { Console.WriteLine(transaction.Id); Console.WriteLine(transaction.Description); }
ranging from data from a server, to data in the applications memory and so on. Depending on what your apps logic is, you might need to store a list of things at some point and arrays are one of the most common data structures that exist for this scenario. This data can exist: ★ In your applications memory ★ On a backend database ★ In a cache somewhere ★ In a file on a computer @adoranwodo STORING DATA REAL LIFE USES OF ARRAYS
elements is not by their physical placement in memory. Instead, each element has a reference to the next element. @adoranwodo Element 1 Element 2 Element 3 NULL
fields. ❖ Data field: This field contains the data that is contained in the node. The programmer can store whatever data they want here, based on what their logic is. ❖ Reference field: This field contains the reference to the next (or previous) node in the sequence depending on the type of linked list. @adoranwodo 45 NODE B NODE A Data Next Ref 10 NODE C NODE B Data Next Ref 200 NODE C Data Next Ref
have a “Next” reference. What this means is that you have one reference field that points to the next element in the sequence. @adoranwodo 45 10 200 NULL 45 NODE B NODE A Data Next Ref 10 NODE C NODE B Data Next Ref 200 NODE C Data Next Ref
two (double) references. One is a next reference and the other, a previous reference. What this means is that you have two reference fields where one points to the next element in the sequence and the other points to the previous element @adoranwodo 45 NODE B NODE A Data Next Reference 10 NODE C NODE B 200 NODE C 45 10 200 NULL Previous Reference NODE A Data Next Reference Previous Reference Data Next Reference Previous Reference NODE B
two (double) references. One is a next reference and the other, a previous reference. What this means is that you have two reference fields where one points to the next element in the sequence and the other points to the previous element @adoranwodo 45 NODE B NODE A Data Next Reference 10 NODE C NODE B 200 NODE C 45 10 200 Previous Reference NODE A Data Next Reference Previous Reference Data Next Reference Previous Reference NODE B NODE C NODE A
an associative manner. In a hash table, data is stored in an array format, where each data value has its own unique index value. Access of data becomes very fast if we know the index of the desired data. @adoranwodo