Data Structures Flashcards

1
Q

Contiguous vs linked data structures

A

Contiguously-allocated structures are composed of single slabs of memory, and
include arrays, matrices, heaps, and hash tables.

Linked data structures are composed of distinct chunks of memory bound
together by pointers, and include lists, trees, and graph adjacency lists

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

Array

A

A contiguously allocated data structure. Arrays are typically of fixed size. Elements can be accessed by their index.

Accessing by index: O(1)
Insert in the beginning;O(n)
Insert at the end: O(1) amortized
Insert in the middle: O(n)
Delete complexity is the same as insert.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly