Data Structures & STL Flashcards

(22 cards)

1
Q

int

A

Signed integer;
fast, common for counters, indices, quantities.

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

uint

A

Non-negative integer;
useful for sizes, counts, bit manipulations.

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

float/double

A

used for prices, computations requiring decimals.

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

char

A

used in strings, parsing, small memory footprints.

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

bool

A

true/false flags, conditional states.

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

vector

A

Dynamic array; contiguous memory
Good for cache locality and fast iteration.

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

deque

A

Double-ended queue
slightly less cache-friendly than vector.

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

list

A

Doubly/singly linked list
Good for frequent insert/remove, but poor cache locality.

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

array

A

Fixed-size array; stack-allocated, no dynamic resizing.
Useful for small fixed-size buffers or embedded contexts.

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

string

A

Dynamic character sequence;
Widely used for identifiers, messages, parsing.
Associative Containers

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

set

A

Ordered unique elements;
good for fast lookup and sorted data.

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

map

A

Ordered key-value pairs;
good for dictionaries with sorted keys.

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

unordered_set

A

Hash-based unique elements;
useful for fast membership tests.

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

unordered_map

A

Hash-based key-value pairs;
good for fast lookups where ordering isn’t required.

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

stack

A

LIFO structure;
Useful for undo operations, recursion emulation.

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

queue

A

FIFO structure;
Good for task scheduling, event handling.

17
Q

priority_queue

A

Heap-based max/min queue;
useful for event scheduling, order books, or top-K elements.

18
Q

iterator

A

Object to traverse containers

19
Q

sort

A

Sort container elements;
Useful for ordered output or binary search prep.

20
Q

find

A

Linear search;
Simple element existence check.

21
Q

binary_search

A

Logarithmic search on sorted data;
Fast membership check.

22
Q

lower_bound / upper_bound

A

Binary search returning iterators;
useful for range queries in ordered containers.