Intro to DSA Flashcards

1
Q

what is a data structure?

A

a way of organizing, storing, and performing operations on data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

record

A

ds that stores subitems. called fields, with a name associated with each subitem (typically found in databases)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

array

A

ds stores an ordered list of items and is accessible by a positional index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

linked list

A
  • ds stores an ordered list of items in nodes
  • each node stores data and has a pointer to next node
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

binary tree

A

ds where each node stores data and has up to two children (left and right child)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

hash table

A

ds stores unordered items by mapping (or hashing) each item to a location in an array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

max-heap

A

tree maintains simple property that node’s key is greater than or equal to node’s childrens’ keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

min-heap

A

tree maintains simple property that node’s key is less than or equal to node’s childrens’ keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

graph

A

ds for representing connections among items, and has vertices connected by edges

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

vertex in graph ds

A

represents an item in a graph

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

edge in graph ds

A

represents a connection between two vertices in a graph

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

algorithm

A

set of commands that must be followed for computer to perform calculations or solving a problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

characteristics of an algorithm

A

unambiguity, finiteness, well-defined inputs, well-defined outputs, effectiveness, feasibility, and language independence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

abstract data type (adt)

A

data type described by predefined user operations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

9 common ADTs

A

list, dynamic array, stack, queue, deque, bag, set, priority queue, dictionary (map)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

ADT: list

A

holds ordered data

ex. array, linked list

17
Q

ADT: dynamic array

A

holds ordered data and allows indexed access

ex. array

18
Q

ADT: stack

A

items only inserted on or removed from top of stack

ex. linked list

19
Q

ADT: dictionary (map)

A

associates or maps keys with values

ex. hash table, binary search tree

20
Q

ADT: queue

A

items inserted at end of queue and removed from front of queue

ex. linked list

20
Q

ADT: priority queue

A

each item has a priority and items with higher priority are closer to front of queue than items with lower priority

ex. heap

20
Q

ADT: deque (pronounced “deck”)

A

items can be inserted and removed at both front and back

ex. linked list

21
Q

ADT: bag

A

stores items and order does no matter and duplicate items are allowed

ex. array, linked list

22
Q

ADT: set

A

for collection of distinct items

ex. binary search tree, hash table

22
Q
A
22
Q

huffman coding

A

common compression technique that assigns fewer bits to frequent items, using a binary tree