/// <summary>
/// 判断是否有交集
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="list1"></param>
/// <param name="list2"></param>
/// <returns></returns>
public static bool IsArrayIntersection<T>(List<T> list1, List<T> list2)
{
List<T> t = list1.Distinct().ToList(); var exceptArr = t.Except(list2).ToList(); if (exceptArr.Count < t.Count)
{
return true;
}
else
{
return false;
} }

c# 判断两个集合是否有交集的更多相关文章

  1. mysql判断两个时间段是否有交集

    //判断两个时间段是否有交集 private function checkTimeCross($start_time,$end_time){ $sql ) AND ((start_time > ...

  2. C# 判断两个集合(List)是否相等

    1.两个list如果有重复元素(如List1: a,b,a  List2: b,b,a) 是无法通过包含关系来判断是否相等的. 有两个办法,其一是两个List排序后再按顺序比较.另一个办法就是计算各元 ...

  3. js判断两个时间段是否有交集

    //判断两个时间是否有交集 function isDateIntersection(start1, end1, start2, end2) { var startdate1 = new Date(st ...

  4. sql语句判断两个时间段是否有交集

    场景:  数据库有有两个字段.开始时间<startTime>,和结束时间<endTime>,指定一个时间段(a,b),a表示开始时间,b表示结束时间.看数据库中有没有与(a,b ...

  5. java 判断两个时间段是否有交集

    /* 开始时间 */ Date leftStartDate = feesPreferential.getPreferentialStartTime(); /* 结束时间 */ Date leftEnd ...

  6. java 判断两个时间段是不是有交集

    如上图:X Y  Z  分别为传来的开始时间可能位于数据库中时间段的位置. X有三种可能 即传来的开始时间为与数据可中某条数据的开始位置!      这样他的结束时间就有三种可能       1.位于 ...

  7. C++ 判断两个圆是否有交集

    #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include <math.h> #include <easyx.h ...

  8. sql 判断两个时间段是否有交集

    本文转自CSDN 链接地址:http://blog.csdn.net/dasihg/article/details/8450195 时间段:starttime_1到endtime_1,starttim ...

  9. php 判断两个时间段是否有交集

    一开始,没啥思路,全靠百度,记录一下哈 public function demo(){ //例子 $astart = strtotime("1995-06-16 12:00:00" ...

随机推荐

  1. sql开启xp_cmdshell

    sql开启xp_cmdshell sp_configure reconfigure go sp_configure reconfigure go

  2. DOS口令启用停用的管理员密码

      运行,输入cmd,但是不回车,鼠标右键cmd那个   快捷方式,有个以管理员身份运行,进入的dos是     c:\windows\system32>   输入   c:\windows\s ...

  3. malloc()与calloc区别 (转)

    另外说明: 1.分配内存空间函数malloc 调用形式: (类型说明符*) malloc (size) 功能:在内存的动态存储区中分配一块长度为"size" 字节的连续区域.函数的 ...

  4. 全面了解POI操作Microsoft Office(Word、Excel、PowerPoint)

    POI 与 Microsoft Office 1. POI 简介 POI 是 Apache 下的 Jakata 项目的一个子项目,主要用于提供 java 操作 Microsoft Office 办公套 ...

  5. Elasticsearch-2.4.3的3节点安装(多种方式图文详解)(含 head、kopf、marvel、shield和watcher插件安装和使用)

    前提: Elasticsearch-2.4.3的下载(图文详解) Elasticsearch-2.4.3的单节点安装(多种方式图文详解) 我这里,以192.168.80.10(HadoopMaster ...

  6. Gearmand 任务分发系统

    简介: Gearmand 是一个用来把工作委派给其它机器.分布式的调用更适合做某项工作的机器.并发的做某项工作在多个调用间做负载均衡.或用来调用其它语言的函数的系统. 简单来讲,就是客户端程序把请求提 ...

  7. zt <Windows Image Acquisition (WIA)> from msdn

    Windows Image Acquisition (WIA)   Windows Image Acquisition (WIA) is the still image acquisition pla ...

  8. Linux重启mysql Error getting authority: Error initializing authority: Could not connect: Resource temporarily unavailable (g-io-error-quark, 27)

    问题: Linux下重启mysql: systemctl restart mysqld 出现以下错误: Error getting authority: Error initializing auth ...

  9. NSArray & NSDictionary

    一.NSArray 1.1 简单创建方法由难到简 NSArray *arr = [[NSArray alloc] init]; NSArray *arr = [NSArray arrayWithObj ...

  10. AlienWare

    https://www.chiphell.com/thread-1705089-1-1.html AlienWare