cs paper 1... Flashcards

1
Q

tree

A

-form of graph
-connected
-undirected
-has no cycles (no path that returns to start node without traversing an edge twice)

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

rooted trees

A

-root node (at the top)
-root connects to 0/1/more child nodes
-nodes at the bottom are leaf nodes
-nodes connected via edges

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

applications of rooted tree

A

-storing/ managing file and folder structures
-implementations of A* pathfinding algorithm

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

Binary tree

A
  • rooted tree with 2 children max.
  • binary search tree = can be searched quickly and easily for an item,new items easily added and whole tree can be printed out in sequence
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

applications of binary tree

A

-wireless networking/ router tables
-operating system scheduling processes
-cryptography

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

operations on tree

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

Hash tables

A

-immediately find an item in a list without need to compare other item
-programming laguages use it to implement a dictionary
-hashing function used to calculate position of an item in a hash table
-needs to be big enough to store all data items, but made bigger to minimise chance of collisions

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

properties of a good hashing function

A

-be calculated quickly
-result in as few collisions as possible
-use as little memory as possible

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

solving collisions from hashing functions

A
  1. OPEN ADDRESSING = repeatedly check next available space in hash table until empty position is found and store there
    • to find item, hashing function delivers start position and then linear search finds items
    • disadvantage is that it prevents other items from being stored at their correct location in hash table
    • disadvantage results in clustering, several positions being filled around common collision values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

hashing algorithm trade-off

A

-efficiency of algoritm and size of hash table

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

resolving collisions

A

-use a two-dimensional hash table
-possible for more than 1 item to be placed in same position
-use 2nd table for collisions, can be searched sequentially
-use a linked list, can be searched sequentially

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

applications of hash tables

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

operations of hash tables

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

breadth first

A

-node-based method of finding shortest path through a graph
-makes use of queue data strcuture- FIFO
-one node selected at a time, visited and maked, then adjacent nodes are visited and stored in a queue

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