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


    Question

    What is the space complexity of Bubble

    Sort?
    A O(N) Correct Answer Incorrect Answer
    B O(log N) Correct Answer Incorrect Answer
    C O(N^2) Correct Answer Incorrect Answer
    D O(1) Correct Answer Incorrect Answer
    E O(N log N) Correct Answer Incorrect Answer

    Solution

    Bubble Sort is an in-place sorting algorithm, meaning it sorts the elements within the original array without requiring significant additional memory. It only needs a few extra variables for temporary storage during swaps, leading to O(1) auxiliary space complexity.

    Practice Next
    ask-question