I am struggling with the calculation of the worklist algorithm, I do not want to implement the iterative algorithm as so many redundant steps it takes.
The algorithm I am following to calculate the worklist for live variables is as below

Can anybody explain to me for the example given below, what would be the initial worklist and how the worklist algorithm would be applied to this?
x = 1 /*block 1*/
y = 23 /*block 2*/
x = 100 /*block 3*/
print x+y /*block 4*/
I have calculated these many equations for In[n] block only, apart from this I am not getting how to construct a worklist, which nodes shall I insert into it and when shall I remove particular nodes from the worklist in order to make it empty at the end.
in[4] = use[4] U (out[4] - def[4])
= {x, y} U { }
in[3] = use[3] U (out[3] - def[3])
= { } U { y }
in[2] = use[2] U (out[2] - def[2])
= { } U { y } - { y }
in[1] = use[1] U (out[1] - def[1])
= { } U { }
I am using Nilson's Algorithms chap-6 to understand this concept. Here they have given an explanation for reaching definition (slide 15), but I am interested in the live variable analysis for the worklist.