« first day (749 days earlier)      last day (3692 days later) » 

2:31 AM
Anyone know how to find the intersection of two NPDAs?
 
 
6 hours later…
8:14 AM
@soandos Not, in general. CFL is not closed against intersection.
 
 
4 hours later…
12:12 PM
Hello
I need some to help me with algorithm design
Anyone can help?
This is a question
N runners participate in a 100-meter sprinting competition. All runners are seeded from number 1 to number n. After all the running heats are over, the competition results are determined by comparing the time. The sprinter with the fastest time is ranked 1st and the sprinter with the slowest time ranked nth.

Write an algorithm that computes the number of sprinter pairs that have the competition results opposite to the pairs’ seed numbers.

The running time of the algorithm must be O(nlgn).

Input: list of seed numbers according to the sprinter results, from the fastest to the slowest.
 
@Hakeem What have you tried? Where did you get stuck?
 
12:34 PM
I need this for my class project, please
 
@HakeemIbnFaisal All the more reason to apply yourself first and only then ask for help, sharing what you've tried.
 
If you have a specific problem, we can (try to) help you with that. But we are not here to do your homework.
 
yes, this what I have tried
def sortRunner(A):
if len(A) < 2:
return A

mid = len(A) / 2
left = A[:mid]
right = A[mid:]

left, right = sort(left), sort(right)

return merge(left, right)
 
What are your thoughts behind this? Why do you think this solves the problem?
 

« first day (749 days earlier)      last day (3692 days later) »