列表,重复项目 [英] list , duplicated items

查看:65
本文介绍了列表,重复项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨每一个



如果我有两个列表< string>

例如

list: list1

a,b,c,d,d,v,b,a



列表:list2

a,b,d



如何在list1中找到元素list2的索引

i意味着结果是

0,1,3,4,6,7





注意:

我的第一个清单包含至少500000元

和第二个列表约3000元





所以我的问题是时间




非常感谢

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

推荐答案

hi,



对于所有类型的排序都要通过此链接。



点击此处进行排序 [ ^ ]


您可以对两个列表中的项目进行排序(跟踪其原始位置)加快搜索速度。
You may sort the items of both the lists (keeping track of their original position) to speed up the search.


hi,





所有这些元素都在数据库中或某些文件?

如果数据库使用JOINS ...

如果文件插入数据库然后使用JOINS ......



Are all these elements in database or some files?
if database use JOINS...
If files insert into database and then use JOINS...


这篇关于列表,重复项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆