问题:
我有两个可能长度不同的数组.我需要迭代两个数组并找到相似之处,添加和删除.
在C#中实现这一目标的最快,最有效的方法是什么?
编辑: 数组已预先排序,它们可以包含50到100个项目之间的任何位置.此外,对速度和/或内存使用没有任何限制(但是,没有人喜欢内存耗费;)
例如:
String[] Foo_Old = {"test1", "test2", "test3"};
String[] Foo_New = {"test1", "test2", "test4", "test5"};
Run Code Online (Sandbox Code Playgroud)
和
String[] Bar_Old = {"test1", "test2", "test4"};
String[] Bar_New = {"test1", "test3"};
Run Code Online (Sandbox Code Playgroud)
区别:
(关于Foo_New数组)
[Same] "test1" [Same] "test2" [Removed] "test3" [Added] "test4" [Added] "test5"
(关于Bar_New数组)
[Same] "test1" [Removed] "test2" [Removed] "test4" [Added] "test3"
我需要一种方法来使用C#或C++为Windows XP/Vista中的文件夹和文件创建Icon Overlay?任何例子?
谢谢, - 西恩!