Patreon Link: / adityaverma
Video Pdf Notes And Code: / 39839473
IBH Video: • Hypothesis-Induction-Base Condition
Sort an Array Using Recursion: • Sort An array using Recursion
Problem Description: https://practice.geeksforgeeks.org/pr...
There are n people standing in a circle (numbered clockwise 1 to n) waiting to be executed. The counting begins at point 1 in the circle and proceeds around the circle in a fixed direction (clockwise). In each step, a certain number of people are skipped and the next person is executed. The elimination proceeds around the circle (which is becoming smaller and smaller as the executed people are removed), until only the last person remains, who is given freedom.
Given the total number of persons n and a number k which indicates that k-1 persons are skipped and kth person is killed in circle. The task is to choose the place in the initial circle so that you are the last one remaining and so survive.
Consider 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 position 5 is killed. So the person at position 3 survives. .
------------------------------------------------------------------------------------------
Here are some of the gears that I use almost everyday:
🖊️ : My Pen (Used in videos too): https://amzn.to/38fKSM1
👨🏻💻 : My Apple Macbook pro: https://amzn.to/3w8iZh6
💻 : My gaming laptop: https://amzn.to/3yjcn23
📱 : My Ipad: https://amzn.to/39yEMGS
✏️ : My Apple Pencil: https://amzn.to/3kMnKYf
🎧 : My Headphones: https://amzn.to/3kMOzM7
💺 : My Chair: https://amzn.to/385weqR
🛋 : My Table: https://amzn.to/3kMohtd
⏰ : My Clock: https://amzn.to/3slFUV3
🙋🏻♀️ : My girlfriend: https://amzn.to/3M6zLDK ¯\_(ツ)_/¯
PS: While having good gears help you perform efficiently, don’t get under the impression that they will make you successful without any hard work.
Смотрите видео Josephus Problem | Game of Death in a circle | Execution in Circle онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Aditya Verma 29 Июль 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 124,935 раз и оно понравилось 4.2 тысяч людям.