Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- class ASP {
- public static void asp(int a[], int b[], int n) {
- int i , j;
- // First Activity always gets selected
- i = 0;
- System.out.println(i);
- for(j = 1 ; j < n; j++) {
- if(a[j] >= b[i]) {
- System.out.println(j);
- i = j;
- }
- }
- }
- public static void main(String[] args) {
- int a[] = {1, 3, 0, 5, 8, 5};
- int b[] = {2, 4, 6, 7, 9, 9};
- int n = a.length;
- asp(a, b, n);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement