Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
394 views
in Technique[技术] by (71.8m points)

下列程序(m转换为n进制)的时间复杂度是多少,为什么?

SeqStack* convertToType(int number, int type) {

SeqStack* stack = new SeqStack;
stack->top = -1;
while (number != 0) {
    int rest = number % type;
    if (stack->top < 99) {
        stack->data[++stack->top] = rest;
    }
    else {
        cout << "out of memery";
    }
    number = (number - rest) / type;
}
return stack;

}


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...