Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

linear search algorithm c#

static int LineSearch(int[] n,int num) {
        for(int i = 0; i < n.Length; i++)
            if(n[i] == num) return i;
        return -1;
    }
 
PREVIOUS NEXT
Tagged: #linear #search #algorithm
ADD COMMENT
Topic
Name
6+9 =