Answers for "linear search c#"

C#
0

linear search c#

static int LineSearch(int[] numbers, int num)
        {
            for (int i = 0; i < numbers.Length; i++)
            {
                if (numbers[i] == num)
                {
                    return i;
                }
            }
            return -1;
        }
Posted by: Guest on May-25-2021
0

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;
    }
Posted by: Guest on June-02-2021

C# Answers by Framework

Browse Popular Code Answers by Language