How do you get the index of a number in a linked list?

后端 未结 5 358
天命终不由人
天命终不由人 2021-01-14 01:50

I have a linked list constructed as follows:

LinkedList linked = new LinkedList();
var array = new int[] { 23, 55, 64, 65 };
foreach (         


        
5条回答
  •  情话喂你
    2021-01-14 02:18

    I think you should make your own function to parse the list and check. The "Find" function returns only the first occurrence and,for you, it is possible to have 2 or more occurrences of 64 in the list.

提交回复
热议问题