using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace ConsoleApplication14
{
class section//数组计算交集并集类
{
//并集方法
public string[] union(string[] e1, string[] e2)
{
ArrayList union = new ArrayList();
foreach (string x in e1)
{ union.Add(x); }
for (int i = 0; i < e2.Length; i++)
{
if (e1.Contains(e2[i]) == true)
{ ///说明有相同的元素在该字符串里面,进行下次操作;
///
continue;
}
else
{
union.Add(e2[i]);
}
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载