Whats the definition of a list | A finite collection of ordered data |
Which is the best definition of array-based list? | A list in which the storage order corresponds to the logical order |
Whats a sequence/ list? | Its a finite ordered collection of data |
Desrcibe the way a list wokrs | ???????????????????????????????????????????????????????????????? NOdes ??????????? |
Stacks and Queues are specialist types of what? | Lists |
How would u impliment an array based list? | What an array |
Are arrays static or dynamic? | Static
Cant change size at runtime |
Define what a generic list is | A list whereby the type of its contents arent predetermined
So a generic list could be a list of:
integers
strings
booleans... |
How do u declare a generic datatype in C# | <> |
What are the advatnages of generic lists | Have lots of useful methods
Maximize code reuse
Maximise performance |
What are the disadvatnages of generic lists | Allow for more mistakes to be made
Allow for lazy codying |
What is special about a sorted list | The elements are in some sort of order |
State the process of adding an item in a sorted list | Start at the bottom of the list
Work up the list, comparing each item with the item to be inserted: if its greater in terms of the way in which the list is ordered then move it down
Stop when you reach an item which comes before the new item
Insert the new item one below that point |
When adding an item to a sorted list, what if the list is empty? | The item to be inserted will become the first item |
When adding an item to a sorted list, what if the list is full? | An exepction will be thrown |
Describe what happens to the other items when adding a new item in the first position of a list | Every item after will have to be moved down 1 |
State the process of removing the nth item in a sorted list | IDK?
Start at the bottom of the list
Work up the list, comparing each item with the item to be removed: if they are equal to eachother then remove the item |