文件名称:Majo1
介绍说明--下载内容均来自于网络,请自行研究使用
给定含有n 个元素的多重集合S = { a1,a2 ,……,an} ,1≤ai≤n,1≤i≤n。
每个元素在S中出现的次数称为该元素的重数
多重集S中重数大于n/2 的元素称为主元素
设计一个O(n)时间算法,计算S 的主元素
-Given the multiple of n elements containing the set S = {a1, a2, ......, an}, 1 ≤ ai ≤ n, 1 ≤ i ≤ n. Each element in S is called the number of occurrences of the element multiplicity of heavy multi-set S is greater than n/2 elements is called the primary element design an O (n) time algorithm to calculate the main elements of S
每个元素在S中出现的次数称为该元素的重数
多重集S中重数大于n/2 的元素称为主元素
设计一个O(n)时间算法,计算S 的主元素
-Given the multiple of n elements containing the set S = {a1, a2, ......, an}, 1 ≤ ai ≤ n, 1 ≤ i ≤ n. Each element in S is called the number of occurrences of the element multiplicity of heavy multi-set S is greater than n/2 elements is called the primary element design an O (n) time algorithm to calculate the main elements of S
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Majo1.cpp