690 views
0 votes
0 votes
7 var occurs in a loop of computer programm.The variable nd step during which they must be stored are

t: step 1 through 6;u:step2;:steps 2 through 4 ;w:step 1 ,3 and 5;x:step 1 and 6;y:step3 through 6; nd z:step 4 nd 5. How many different index registers are needed to store these variables during execution?

3 Answers

0 votes
0 votes
sorry i dint get ur question.but in ur question is u from 2 to 4? if yes then

I got it  5 as the allocation graph is 5 colorable

SOMEONE PLEASE RECTIFY ME IF M WRONG AND MAKE ME UNDERSTAND
0 votes
0 votes

register allocation is application of graph coloring

steps variables
1 t x w
2 t u v
3 t v w  y
4 t v y z
5 t w y z
6 t x y

here vertices represent variables 

there is edge between variables if they are reqd at same time.

t v w y x z u
6 5 5 5 4 4 2
c1 c2 c3 c4 c2 c4 c3

5 registers are required

Related questions

0 votes
0 votes
1 answer
1
Sahil_Lather asked Apr 15, 2023
472 views
Graph G is obtained by adding vertex s to $K_{3,4}$ and making s adjacent to every vertex of $K_{3,4}$ .The find the minimum number of colours required ot edge-colour is ...
2 votes
2 votes
1 answer
2
Na462 asked Jan 16, 2019
519 views
The number of vertices,edges and colors required for proper coloring in Tripartite graph K<3,2,5 will be :10 , 31 , 310 , 30 , 310 , 30 , 2None
4 votes
4 votes
2 answers
3
Balaji Jegan asked Nov 27, 2018
2,593 views
How many ways are there to color this graph from any $4$ of the following colors : Violet, Indigo, Blue, Green, Yellow, Orange and Red ?There is a condition that adjacent...
3 votes
3 votes
1 answer
4