拍卖模型时间复杂度

时间:2015-04-14 10:56:24

标签: algorithm time-complexity

我有双重拍卖机制的基本算法,我很难找到Big-O时间复杂度。我应该采取哪些步骤来严格分析此算法?

我知道Big-O表示法是算法时间复杂度的表示法,它表示算法缩放因子极限的上限。

但是,我不确定如何使用第二个函数来定义算法的上限。

While (r = min(supply, demand)) {
    oa = Pul;
    ob = Pll;
    While {true} {
        nondetermistic choice;
        If (a buyer submits a bid:) {
            If (bid = ob or out of [Pll, Pul]) {
                bid is an invalid bid;
            } else { 
                bid updates ob and becomes a new ob;
            }
            If (ob = oa) {
                Pt = oa;
                The round is ended;
            }
        } ElseIf (a seller submits an ask:) {    
            If (ask = oa or out of [Pll, Pul]) {
                ask is an invalid ask;
            } else {
                ask updates oa and becomes a new oa;
            }
            If (ob = oa) {
                Pt = ob;
                The round is ended;
            }
        } Else (time out:) {
            If (no new oa or ob in a pre-specified time period) {
                The round is ended with no transaction;
            }
        }
        end nondetermistic choice ;
    }
    r = r + 1;
}

0 个答案:

没有答案