Find index of number in array using C#

preview_player
Показать описание
Find the position or index of a number in an array using C#. The function will have 2 arguments, first argument is the array to be searched and second argument is the number to find in first argument. All the solutions require the array to be sorted first before find the index of given number.

Here there are 4 solutions for the problem which will use for loop, while loop and extension methods on array provided by LINQ.

Timeline for the solutions are :
1st Solution (for loop) : 0:12
2nd Solution (while loop) : 0:38
3rd Solution (LINQ) : 1:10
4th Solution (FindIndex) : 1:37

Please leave comments if you have suggestion or query related to programming in general, will try my best to reply asap.

PLEASE SUBSCRIBE OUR CHANNEL FOR MORE OF SUCH VIDEOS.
WE NEED YOUR SUPPORT..❤

▶ Thanks for watching ◀
Рекомендации по теме