1/16
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is a data structure?
Containers which store information
—> Differently suited
What is an array?
An indexed set of related elements
What are the characteristics of an array?
Finite
Indexed
Contains elements of the same data type
How is an array declared in C#?
type[ ] arrayName;
How is information stored by a computer?
As a series of files
File > Record > Field
How is the File class used in C#?
using System.IO;
How do you create a file in C#?
File.Create("FileName.type");
How do you read from a file in C#?
File.ReadAllText("FileName.type");
How do you write to a file in C#?
File.WriteAllText("FileName.type", "__");
What is an abstract data type?
A logical description of how we view data and possible operations
↳ Only concerned with what data is representing, not its construction
What is encapsulation?
Hiding the details of implementation from the user
What is a dynamic data structure?
Collection of data which can grow or shrink in size using a heap
What is meant by a heap?
Portion of memory from which space is automatically (a/de)llocated as required
Where are dynamic data structures useful?
Implementing structures when the maximum size is not known in advance
↳ e.g. queues
What is a static data structure?
Data structure which is fixed in size
—> e.g. arrays
What is an advantage of static data structures?
Pointers do not need to be stored
↳ Saves memory
What is a disadvantage of static data structures?
Memory allocated to it cannot be reallocated, even if it unused