Boyer–Moore majority vote algorithm

Boyer–Moore majority vote algorithm
ダウンロード: 242
更新 2015/12/9

ライセンスの表示

%% Boyer–Moore majority vote algorithm
% The Boyer-Moore Vote Algorithm solves the majority vote problem in
% linear time O(n) and logarithmic space O(\log n). The majority vote
% problem is to determine in any given sequence of choices whether
% there is a choice with more occurrences than all the others, and if so,
% to determine this choice. Mathematically, given a finite sequence
% (length n) of numbers, the object is to find the majority number
% defined as the number that appears more than floor(n/2) times.%
%
% Example:
%
% consider we want to find the majority element in 'aaaccbbcccbcc'
% MajorityVote('aaaccbbcccbcc')
% ans =
% c
%

引用

Reza Ahmadzadeh (2026). Boyer–Moore majority vote algorithm (https://jp.mathworks.com/matlabcentral/fileexchange/54394-boyer-moore-majority-vote-algorithm), MATLAB Central File Exchange. 取得日: .

MATLAB リリースの互換性
作成: R2007a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersGenetic Algorithm についてさらに検索
バージョン 公開済み リリース ノート
1.0.0.0