[ create a new paste ] login | about

Link: http://codepad.org/dTqTotkt    [ raw code | output | fork ]

C, pasted on Jun 30:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "function.h"

int BS(int *input, int q, int n)
{
    int mid= *(input+ (n/2));

	if (q> mid)
    {
        return n/2+1 + BS(input+ (n/2+1), q, (n-1)/2);
    }

    else if (q< mid)
    {
        return BS(input, q, n/2);
    }

    else if (q = mid)
    {
        return n/2;
    }
}


Output:
1
Line 21: error: function.h: No such file or directory


Create a new paste based on this one


Comments: