Search:

Type: Posts; User: ashutosh124

Search: Search took 0.01 seconds.

  1. Finally got the correct answer!!!!! Thanks ...

    Finally got the correct answer!!!!! Thanks



    #include<stdio.h>
    #include<stdlib.h>


    struct node{
    int data;
  2. problem in merge sorting the linked lists

    The following program throws runtime error.Please help me fix it.


    #include<stdio.h>
    #include<stdlib.h>


    struct node{
    int data;
    struct node *next;
  3. How does compiler solve this expression

    The expressions and their output as seen on Codeblocks 12.11 are -

    int i = 1, x;
    x = i++ + i++ + ++i ++i
    output : x = 7 and i = 5;

    But for the following -

    int i = 1, x;
    x = ++i ++i +...
  4. Adak, the two algos to find the max-min that you...

    Adak, the two algos to find the max-min that you talked about are straightforward and I know this. What I want to do is to implement the "divide and conquer approach" to it. But your such a long...
  5. But how to increase the warning level of the...

    But how to increase the warning level of the compiler, presently it shows zero errors and zero warnings.
  6. The modified code is below, which still prints...

    The modified code is below, which still prints the incorrect max- min.


    #include<stdio.h>
    #include<conio.h>
    int maxmin(int,int,int *,int *);
    int num[20];
    main()
    {
    int max,min; int n,i;
  7. Replies
    6
    Views
    11,700

    the example array- 7,5,3,8 Expected output- the...

    the example array- 7,5,3,8
    Expected output- the index of pivot element is 2 and the partitioned array is
    3 5 7 8
    obtained output- after entering the array, the program...
  8. At c99tutorial, Can you...

    At c99tutorial,
    Can you please write the modified code using both "global" and "local" scopes to better help me get the concept.
  9. Thanks c99tutorial, to help me fix the problem in...

    Thanks c99tutorial, to help me fix the problem in the code.
    I just made a slight change- called srand(time(NULL)) before calling the rand() function and it works fine now.
    But I wonder what could...
  10. I am sorry, actually the problem is that the...

    I am sorry, actually the problem is that the program does not print the repeated element. It simply stops responding, I tried it on 'codeblocks'.
  11. problem in deletion in binary search tree

    I wrote a function to delete a node in the binary search tree. The code works well in case of node having no child but fails when the node has one or two child.


    void deleteNode(bstree...
  12. Replies
    6
    Views
    11,700

    After replacing (a+i) with *(a+i) also the...

    After replacing (a+i) with *(a+i) also the problem remains the same- the partitioned array is not printed. I think there is some run time problem which I find difficult to fix.
  13. The problem with the code is that -line number 14...

    The problem with the code is that -line number 14 1nd 15 do not execute, that is the pivot element and the partitioned array is not printed.
  14. Thanks for pointing the mistake.

    Thanks for pointing the mistake.
  15. As the variables- max and min have already been...

    As the variables- max and min have already been made global and the function-'maxmin' being called before the maximum and minimum values are printed, am I supposed to pass the references- &max,&min?
  16. find repeated elements in an array using randomized algorithm

    Given an array of size n having n/2 distinct and the rest identical elements ,write a C program to find the repeated one using randomized algorithm.
    I have written the code but it has some problem...
  17. problem in divide and conquer approach to find max-min

    Can anyone help me fix the problem with the code for finding max-min in an array?


    #include<stdio.h>
    #include<conio.h>
    maxmin(int,int,int,int);
    int num[20],max,min,max1,min1;
    main()
    { int...
  18. Replies
    6
    Views
    11,700

    How to partition an array

    There is some problem in the following code that seeks to partition the array (the first element taken as pivot). Please help me fix the issue.


    #include<stdio.h>
    #include<conio.h>
    int...
Results 1 to 18 of 20