fox mulder
BAN USER
- 0of 0 votes
AnswersI've heard this from someone, guess it is not the full question but this question is quite familiar:
- fox mulder in United States
Given some kind of operating system that run Tasks. Every task comes with a certain time it should run. For example first task need to run 15 seconds, after 2 seconds comes another task that need to run another 30 seconds, after 7 seconds comes another task need to run another 2 seconds, etc.
You have a scheduler that runs every second and check which task need to be run and run them.
You don't have system clock and need to find a solution without it.
How would you implement it?| Report Duplicate | Flag | PURGE
Brain Teasers - 0of 0 votes
AnswersGiven a sorted array, with find function that finds value in array in O(1). Suppose I rotate the sorted array at some pivot unknown to you beforehand. So for instance, 1 2 3 4 5 might become 3 4 5 1 2. Write new find function wiht uses of the older find to find element in the rotated array in O(1) time.
- fox mulder in United States| Report Duplicate | Flag | PURGE
Algorithm
Open Chat in New Window
Nice, I wonder how to approch this kind of questions, it felt I didn't had any clue how to approch it.
- fox mulder March 31, 2014