Values associated with keys 's', 'e', 'a', 'r', 'c', 'h' are inserted into a hash table of size $16$ in that order. At what position in the array (i.e., index) is the value associated with 'h' inserted if the hashing is done with linear probing?

Use the graph whose adjacencies are given below to answer questions (a)-(c)

Which data structure, queue or stack, can be used for a (non-recursive) depth-first search algorithm for a graph?

What is an admissible heuristic?

Suppose $h$ is a consistent heuristic function, $n$ and $m$ are adjacent nodes, the cost to get to $m$ from $n$ is $5$, and $h(n) = 6$. Which of the following is true?

$h(m) \le 1$

$h(m) = 1$

$h(m) \ge 1$

there is no way to know anything about the value of $h(m)$.

Show the result of the trace of Dijkstra's shortest path algorithm on the directed, edge-weighted graph whose edge-list representation and resulting adjacency-lists representation are described below, starting from vertex 0

Show the result of the trace of of the lazy version of Prim's Algorithm as it finds the edges of the minimal spanning tree for the graph whose edge-list representation is given by the following, and where vertex 0 is the first vertex visited.

A neural network is designed in the following way. There are two input neurons, A and B with input values (0.1 and 0.7, respectively). 2 hidden neurons, $\alpha$ and $\beta$, and one output neuron $\gamma$. The initial weights are given by the following table:
$$\begin{array}{l}
w_{A \alpha} = 0.1\\
w_{A \beta} = 0.3\\
w_{B \alpha} = 0.5\\
w_{B \beta} = 0.2\\
w_{\alpha \gamma} = 0.2\\
w_{\beta \gamma} = 0.1
\end{array}$$
If the target output is $1$ (and the learning rate is $1$), find the updated weights after one "training pass" on this network. Also, how much closer was the network's output to the target after the training pass?

Answers

It "masks off" the sign bit of the hashCode, ensuring that the result is a non-negative integer (recall array indices are always non-negative)

7

0 7 1 2 4 6 5 3

0 7 5 2 1 6 4 3

0 $\rightarrow$ 7 $\rightarrow$ 4

adjacency list

stack

An admissible heuristic is a function that provides an estimate -- but never an overestimate -- of the distance (or cost) to get from a given node to a desired destination node.

$$\begin{array}{l}
w_{A \alpha} = 0.1007326\\
w_{A \beta} = 0.3004547\\
w_{B \alpha} = 0.5051282\\
w_{B \beta} = 0.2031829\\
w_{\alpha \gamma} = 0.2668\\
w_{\beta \gamma} = 0.16152
\end{array}$$
The network initially produced an output of $0.5429$. After the training, it produced an output of approximately $0.56097$, so after the training the output was approximately 0.01807 closer to the target.