This error make me upset all day.Help!Help! i beg ..


  • 0
    Y

    The case 1,[ ] always hint me the runtime error.i am speechless,my code follows**.i think the code will execute the makerted part.it has no problem .no doubt**! what's wrong with the runtime error.help help help..please

    Last executed input: 1, []
    Stdout: 0order adress:40003216

    int* findOrder(int numCourses, int** prerequisites, int prerequisitesRowSize, int prerequisitesColSize, int* returnSize) {
        int*  order = (int*)malloc(sizeof(int)*numCourses);
        if(numCourses==0){
                *returnSize=0;
                return order;
        }      
        *returnSize=numCourses;
        if(prerequisitesRowSize==0){   
                for(int i=0;i<numCourses;i++){
                        order[i]=i;
                        printf("%d",order[i]);
                }
                printf("order adress:%d",order);
                return order;
        }
        printf("order adressd");
        struct Graph graph;
        createGraph(prerequisites,&graph,prerequisitesRowSize,numCourses);
        topoLogical(&graph,order,returnSize);
        return order;
    

    }


  • 0

    Please try again, I have just fixed an issue in the driver code. It's a silly mistake, sorry about that.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.