您好,欢迎光临本网站![请登录][注册会员]  
文件名称: 闭包搜索算法java编程
  所属分类: 其它
  开发工具:
  文件大小: 4kb
  下载次数: 0
  上传时间: 2009-03-25
  提 供 者: jarvi******
 详细说明: It is important in distributed computer systems to identify those events (at identifiable points in time) that are concurrent, or not related to each other in time. A group of concurrent events may sometimes attempt to simultaneously use the same resource, and this could cause problems. Events that are not concurrent can be ordered in time. For example, if event 1 can be shown to always precede event 2 in time, then event 1 and 2 are obviously not concurrent. Notationally we indicate that event 1 precedes 2 by writing 1 ! 2. Not e that the precedes relation is transitive, as expected. Thus if 1 ! 2 and 2 ! 3, then we can also note that 1 ! 3. Sequential events in a single computation are not concurrent. For example, if a particular computation performs the operations identified by events 1, 2 and 3 in that order, then clearly and 1 ! 2 and 2 ! 3. Computations in a distributed system communicate by sending messages. If event 1 corresponds to the sending of a message by one computation, and event 2 corresponds to the reception of that message by a different computation, then we can always note that 1 ! 2, since a message cannot be received before it is sent. In this problem you will be supplied with lists of sequential events for an arbitrary number of computations, and the identification of an arbitrary number of messages sent between these computations. Let n be the number of events. Your task is to write an O(n3) program to find out how many pairs of events are concurrent. Input The input will include first an integer, nc, specifying the number of computations in the test case. For each of these nc computations there will be a single line containing an integer ne that specifies the number of sequential events in the computation followed by ne event IDs. Following the specification of the events in the last computation there will be a line with a single integer, nm, that specifies the number of messages that are sent between computations. Finally, on each of the following nm lines there will be a pair of event IDs specifying the name of the event associated with the sending of a message, and the event associated with the reception of the message. These IDs will have previously appeared in the lists of events associated with computations. e.g.: 2 2 1 2 2 3 4 1 3 1 Output Your output should be the number of pairs of concurrent events. e.g., the output for the above input should be: 2 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: 查找并发事件
 输入关键字,在本站1000多万海量源码库中尽情搜索: