This is wrong way because theta 0 is assigned before computing temp1. So, this new theta 0 will be used to compute temp1. This is not right.

Alpha in this equation is learning rate. Choosing a suitable learning rate can be tricky. As alpha is multiplied by the slope, if slope is negative theta increases and if the slope is positive theta decreases. The value of alpha can be fixed. There is no need to increase or decrease the value of alpha over time. It is very important to watch the time that is required to converge. If it takes too much time to converge, then the value of alpha needs to be changed. One good way to choose alpha is to make a table of the time required to converge with respect to alpha and choose a optimum value from there.