Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. }
  2. else
  3. {
  4. Console.WriteLine("{0} is located at {1} in the poll", name, location + 1);
  5. }
  6. Console.ReadLine();
  7. }
  8. public static int linearUnsorted(string[] arr, string item)
  9. {
  10. int location = 0;
  11. while (location <arr.Length && !String.Equals(item, arr[location], StringComparison.OrdinalIgnoreCase))
  12. {
  13. location++;
  14. }
  15. if (location == arr.Length)
  16. {
  17. location = -1;
  18. }
  19. return location;
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement