Click here to Skip to main content
15,860,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi every one

if i have two list<string>
for example
list: list1
a,b,c,d,d,v,b,a
and
list: list2
a,b,d

how can i find index of element list2 in list1
i mean the result is
0,1,3,4,6,7


note:
my first list contains at lest 500000 element
and second list about 3000 element


so i problem is time


thanks to all very much
Posted

hi,

For all types of sort go through this link.

Click here, for sorting[^]
 
Share this answer
 
You may sort the items of both the lists (keeping track of their original position) to speed up the search.
 
Share this answer
 
v2
hi,


Are all these elements in database or some files?
if database use JOINS...
If files insert into database and then use JOINS...
 
Share this answer
 
Comments
dabbourabd 17-Apr-13 7:01am    
first thank you for replay
another question if i have
List<string>[] All_files = new List<string>[2];
All_files[0] = new List<string>();//name
All_files[1] = new List<string>();//fullname

how can i sort this list according to All_files[0]
Rockstar_ 17-Apr-13 7:18am    
Check my solution...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900