s*****w 发帖数: 1527 | 1 say
Array 1 = {1, 3, 2, 4}, idx is 0, 1 ,2 3
Array 2 = {1, 2, 3, 4}
how do i know it's idx is actually 0, 2, 1, 3 from Array 1 ?
is there such function ? | N***m 发帖数: 4460 | 2 how about sorting the corresponding map?
【在 s*****w 的大作中提到】 : say : Array 1 = {1, 3, 2, 4}, idx is 0, 1 ,2 3 : Array 2 = {1, 2, 3, 4} : how do i know it's idx is actually 0, 2, 1, 3 from Array 1 ? : is there such function ?
| c**t 发帖数: 2744 | 3 var qry = from b in Array2
select Array.IndexOf(Array1, b);
say
Array 1 = {1, 3, 2, 4}, idx is 0, 1 ,2 3
Array 2 = {1, 2, 3, 4}
how do i know it's idx is actually 0, 2, 1, 3 from Array 1 ?
is there such function ?
【在 s*****w 的大作中提到】 : say : Array 1 = {1, 3, 2, 4}, idx is 0, 1 ,2 3 : Array 2 = {1, 2, 3, 4} : how do i know it's idx is actually 0, 2, 1, 3 from Array 1 ? : is there such function ?
| s*****w 发帖数: 1527 | 4 兄弟,你牛!
【在 c**t 的大作中提到】 : var qry = from b in Array2 : select Array.IndexOf(Array1, b); : : say : Array 1 = {1, 3, 2, 4}, idx is 0, 1 ,2 3 : Array 2 = {1, 2, 3, 4} : how do i know it's idx is actually 0, 2, 1, 3 from Array 1 ? : is there such function ?
| l********f 发帖数: 149 | 5 Linq just looks fancy, underneath the hood it still doing two foreach loop and complexity for this algo is O(n2).
Correct me if i am wrong.
【在 c**t 的大作中提到】 : var qry = from b in Array2 : select Array.IndexOf(Array1, b); : : say : Array 1 = {1, 3, 2, 4}, idx is 0, 1 ,2 3 : Array 2 = {1, 2, 3, 4} : how do i know it's idx is actually 0, 2, 1, 3 from Array 1 ? : is there such function ?
|
|