Engineering
Engineering, 25.10.2019 20:43, alexanderavrett

Use only c language to do this assignmentin this assignment, you have to simulate the josephus problem. there are n number of prisonersstanding in a circle waiting to be executed. the counting out begins at some point in the circle andproceeds around the circle in a fixed direction. in each step, a certain number of people are skippedand the next person is executed. the elimination proceeds around the circle (which is becomingsmaller and smaller as the executed people are removed), until only the last person remains, whois given freedom. given the total number of persons n and a number k which indicatesthat k-1 persons are skippedand kth person is killed in circle. the task is to choose the place in the initial circle so that you arethe last one remaining and so survive. examplefor example, if n = 5 and k = 2, then the safe position is 3. firstly, the person at position 2 is killed, then person at position 4 is killed, then person at position 1 is killed. finally, the person at position5 is killed. so, the person at position 3 survives. if n = 7 and k = 3, then the safe position is 4. the personsat positions 3, 6, 2, 7, 5, 1 are killed inorder, and person at position 4 survives. input: n and koutput: the position number whowill survive.

answer
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 16:10, TheOriginalMeyah
An electrical motor raises a 50kg load at a construct velencity .calculate the power of the motor, if it takes 40sec to raise the load through a height of 24m(take g =9.8n/g)
Answers: 2
image
Engineering, 04.07.2019 18:10, settasav9641
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
image
Engineering, 06.07.2019 03:10, kturvey225
Consider a 1.2 meter high and 2 meter wide glass window whose thickness is 6 mm and thermal conductivity is 0.78 w/m °c. the room temperature is maintained at 24 °c, while the outdoor temperature is -5 °c. the convective heat transfer coefficients on the inner and outer surfaces of the window are 10 w/m2 °c and 25 w/m2 °c respectively. (a) draw the thermal resistance network, etermine the steady rate of heat transfer t e glass window (c) determine the temperature of the inner surface of the window
Answers: 3
image
Engineering, 06.07.2019 03:20, cherkaouinazihp387bk
Figure out the odd statement about ceramics in the following (a) good insulators of heat and electricity (b) usually less desire than metals (c) ductile in nature (d) contains both metallic and nonmetallic elements
Answers: 3
Do you know the correct answer?
Use only c language to do this assignmentin this assignment, you have to simulate the josephus probl...

Questions in other subjects:

Konu
Mathematics, 24.12.2020 20:00
Konu
Mathematics, 24.12.2020 20:00