📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    The amortized cost of appending an element at the end of

    a dynamic array is:
    A O(n) Correct Answer Incorrect Answer
    B O(log n) Correct Answer Incorrect Answer
    C O(1) Correct Answer Incorrect Answer
    D O(n log n) Correct Answer Incorrect Answer
    E O(√n) Correct Answer Incorrect Answer

    Solution

    Amortized cost accounts for infrequent resizing; even with occasional O(n) resizing, average cost is O(1).

    Practice Next
    More Data Structure Questions
    ask-question

    Not sure which exam is best for you Talk to our expert

    Get My Free Call