Computer Fundametals nWeek 1 L2 Q/A Flashcards
1.How can you access each element in an array?
You access each element in an array by knowing its position, called an index. For example, if you want the third element, you look at index 2.
- Explain how you could use an array to keep track of personal best times for the members of an athletic club. Your solution may require several dimensions.
You could use a two-dimensional array. One dimension represents each member, and the other dimension represents each event. So, each spot in the array holds the time for a specific member in a specific event.
- Explain the terms file, record, and field in relation to data structures.
A file holds data, while a record holds related information within the file, and a field holds specific data within a record. Also uses spreadsheets for data
What are the typical uses of text files?
Text files are used for storing human-readable information, like documents, notes, programming code, and configuration settings.
What are the typical uses of binary files?
Binary files are used for storing computer-readable information, like images, videos, programs, and databases.
Examples of dynamic data structures are linked lists and trees. They can change size while the program is running.
Examples of static data structures are arrays and stacks. They have a fixed size that doesn’t change during program execution.
What are the two advantage using Dynamic data. Name 1
Dynamic data structures can grow or shrink as needed, saving memory when not in use.
They are more flexible for storing and organizing data compared to static structures.
Two Disadvantages using Dynamic data. Name 1
Dynamic data structures can be slower and use more memory because they need extra space to manage their size changes.
They may be more complex to implement and maintain than static structures.
Why are stack and queues considered to be dynamic data structures?
Stacks and queues are dynamic because they can change in size as items are added or removed, unlike fixed-size structures.