Algorithms and Data Structures Flashcards

1
Q

Linked List

A

Access and insert O(n)
head insert O(I)
Best of sequencial access cases
Stacks (LIFO) and queues (FIFO)

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

Double Linked List

A

Inserts head and tail O(1)
Access O(n)
Deques
MRU: Most receent access to the head.

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

Binary Search Tree

A

Access is O(log(n)), O(n) worst case
Insert and delete O(log(n)), need of other search to rearrange things

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

Hash Table

A

Hash function maps key to a ‘bucket’
That bucket is then searched for the keys value
Hash collitions, when more than one key maps to the same bucket
Inser, lookups and delete O(1)
Hash collitons O(n)

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

Graphs

A

Social Network, Paths i a city
Vertices, Edges
bfs, dfs

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

Binary Search

A

Starts with a sorted list
Start in the middle, split list and lookup into the part you have to
O(log(n))

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

Search and Info retrieval

A

Forward inex of keywords of each doc
Generate inverted index that maps keywords to docs
Docs need to be ranked. ex. how often the word appears and where

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

TF-IDF

A

Term frenquency just measures how often a word occurs in a doc.
Document Frequency how often a word occurs in an entire set of docs.
Relevancy of a word in a doc: Term Frequency / Document Frequency.

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