4.2.1 Data Structures & Abstract Data Types

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/16

flashcard set

Earn XP

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

17 Terms

1
New cards

What is a data structure?

Containers which store information

—> Differently suited

2
New cards

What is an array?

An indexed set of related elements

3
New cards

What are the characteristics of an array?

  • Finite

  • Indexed

  • Contains elements of the same data type

4
New cards

How is an array declared in C#?

type[ ] arrayName; 
5
New cards

How is information stored by a computer?

As a series of files

File > Record > Field

6
New cards

How is the File class used in C#?

using System.IO;
7
New cards

How do you create a file in C#?

File.Create("FileName.type");
8
New cards

How do you read from a file in C#?

File.ReadAllText("FileName.type");
9
New cards

How do you write to a file in C#?

File.WriteAllText("FileName.type", "__");
10
New cards

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

11
New cards

What is encapsulation?

Hiding the details of implementation from the user

12
New cards

What is a dynamic data structure?

Collection of data which can grow or shrink in size using a heap

13
New cards

What is meant by a heap?

Portion of memory from which space is automatically (a/de)llocated as required

14
New cards

Where are dynamic data structures useful?

Implementing structures when the maximum size is not known in advance

↳ e.g. queues

15
New cards

What is a static data structure?

Data structure which is fixed in size

—> e.g. arrays

16
New cards

What is an advantage of static data structures?

Pointers do not need to be stored

↳ Saves memory

17
New cards

What is a disadvantage of static data structures?

Memory allocated to it cannot be reallocated, even if it unused