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


    Question

    When analyzing the performance of a sorting algorithm,

    what is a common operation to count for time complexity?  
    A Arithmetic operations Correct Answer Incorrect Answer
    B Input/Output operations Correct Answer Incorrect Answer
    C Comparisons and Swaps Correct Answer Incorrect Answer
    D Function calls Correct Answer Incorrect Answer
    E Memory allocations Correct Answer Incorrect Answer

    Solution

    For comparison-based sorting algorithms, the number of comparisons and swaps (or assignments) are the fundamental operations that dominate the running time and are therefore typically counted to determine time complexity.

    Practice Next
    ask-question