DS final

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

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

32 Terms

1
New cards

Data Structure

A systematic way of organizing and accessing data.

2
New cards

Algorithm

A generic step-by-step set of instructions for solving a problem.

3
New cards

Program

An implementation of an algorithm in code.

4
New cards

ADT (Abstract Data Type)

A theoretical model of a data structure that specifies what operations are allowed but not how they are implemented.

5
New cards

Big O Notation

Describes the worst-case complexity of an algorithm.

6
New cards

O(1)

Constant time – operations take the same time regardless of input size.

7
New cards

O(n)

Linear time – performance scales directly with input size.

8
New cards

O(n²)

Quadratic time – performance scales with the square of input size.

9
New cards

O(log n)

Logarithmic time – performance scales logarithmically with input size.

10
New cards

O(bⁿ)

Exponential time – performance doubles with each additional input.

11
New cards

O(n!)

Factorial time – performance grows extremely fast with input size.

12
New cards

Inheritance

A class can inherit attributes and methods from another class.

13
New cards

Constructor (init)

A special function that initializes an object.

14
New cards

Import

Brings in external modules to use functions or classes.

15
New cards

Function

Blocks of reusable code that perform a task.

16
New cards

Public attributes (self.attribute)

Accessible from anywhere.

17
New cards

Protected attributes (self._attribute)

Conventionally private but still accessible.

18
New cards

Private attributes (self.__attribute)

Name-mangled to prevent direct access.

19
New cards

str Method

Defines how an object is represented as a string.

20
New cards

Naming Conventions

Use snake_case for variables/functions and PascalCase for class names.

21
New cards

self Keyword

Refers to the instance of the class.

22
New cards

Stack

A stack is a linear data structure that follows the Last In, First Out (LIFO) principle.

23
New cards

Queue

A queue is a linear data structure that follows the First In, First Out (FIFO) principle.

24
New cards

Deque

A deque is a data structure that allows insertions and deletions from both the front and back.

25
New cards

Node

A fundamental building block of linked data structures, consisting of a data field and a reference to the next node.

26
New cards

AVL Tree

A self-balancing binary search tree.

27
New cards

LL rotation

Needed in AVL trees when a node is left-heavy after deletion and its left child has a balance factor ≥ 0.

28
New cards

RR rotation

Needed in AVL trees when a node is right-heavy after deletion and its right child has a balance factor ≤ 0.

29
New cards

LR rotation

Needed in AVL trees when a left child is right-heavy after deletion.

30
New cards

RL rotation

Needed in AVL trees when a right child is left-heavy after deletion.

31
New cards

Balance Factor

The difference in heights between the left and right subtrees of a node.

32
New cards

Stable Sort

A sorting algorithm that maintains the relative order of records with equal keys.