DATA STRUCTURE (MIDTERMS)

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:48 AM on 9/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

33 Terms

1
New cards

Data structure

A data structure is a special format for storing and organizing data.

2
New cards

Linear

Elements are accessed in a sequential order but may be stored unsystematically

3
New cards

Non-Linear

Elements are stored and accessed in a non-sequential order

4
New cards

Abstract data type (ADT)

A logical description of how data is viewed as well as the operations that are allowed without regard to how they will be implemented.

5
New cards

Benefits of using ADT

  • Code is easier to understand

  • Implementations of ADTs can be changed without requiring changes to the program that uses the ADTs

  • ADTs can be used in future programs


6
New cards

Two (2) parts of ADT

Public or external and Private or internal

7
New cards

Public or external

The data and the operations

8
New cards

Private or internal

The representation and the implementation

9
New cards

Linked list

Used for storing elements where each is a separate object

10
New cards

Stack

An ordered list in which the last element added is the first element retrieved or removed (Last-In, First-Out

11
New cards

Queue

An ordered list in which the first element added is the first element retrieved or removed (First-In, First-Out)

12
New cards

Tree

Represents a hierarchical nature of a structure in a graphical form

13
New cards

Priority queue

A special type of queue where elements are processed based on their order (natural or custom)

14
New cards

Heap

A complete binary tree where the value of each of each parent node is either higher or lower than the value of its child nodes

15
New cards

Set

A collection of elements where each element is unique

16
New cards

Map

A set of ordered pairs where elements are known as keys (identifiers) and values (content)

17
New cards

Graph

Consists of a set of vertices (or nodes) and a set of edges (relations) between the pairs of vertices

18
New cards

Four (4) main operations

  • initializing

  • adding

  • accessing

  • removing of data


19
New cards

Algorithm

An algorithm is a step-by-step set of instructions to be executed in sequence for solving a problem

20
New cards

Characteristics of an Algorithm

  • Finiteness

  • Definiteness

  • Input

  • Output

  • Uniqueness


21
New cards

Finiteness

An algorithm must terminate after a specified number of steps

22
New cards

Definiteness

Each instruction has to be clear and unambiguous

23
New cards

Input

An algorithm should have zero or more well-defined data given before the algorithm begins

24
New cards

Output

An algorithm must have one (1) or more results, with specified relation to the input

25
New cards

Uniqueness

The result of each step depends on the input and/or the result of the previous step

26
New cards

Elements of an Algorithm

  • Sequential operations

  • Actions based on the state of a data structure

  • Iteration

  • Recursion


27
New cards

Iteration

Repeating an action multiple times

28
New cards

Recursion

Occurs when a function calls itself once or multiple times to solve a problem

29
New cards

Algorithm Design Paradigms

  • Divide and Conquer

  • Greedy Algorithms

  • Dynamic Programming


30
New cards

Divide and Conquer

A problem is broken into smaller subproblems

31
New cards

Greedy Algorithms

The optimal approach is always chosen in solving a problem

32
New cards

Dynamic Programming

Similar to Divide and Conquer except that the results of the subproblems are reused for overlapping subproblems

33
New cards

Abstract Data Types

  • Linked list

  • Stack

  • Queue

  • Tree

  • Priority queue

  • Heap

  • Set

  • Map

  • Graph