ЁЯУв Too many exams? DonтАЩt know which one suits you best? Book Your Free Expert ЁЯСЙ call Now!


    Question

    In a data analysis application where two sorted linked

    lists need to be merged into a single sorted linked list, what is the typical time complexity of this operation?
    A O(1) Correct Answer Incorrect Answer
    B O(log n) Correct Answer Incorrect Answer
    C O(n) Correct Answer Incorrect Answer
    D O(m + n) where m and n are lengths of the lists Correct Answer Incorrect Answer
    E O(n log n) Correct Answer Incorrect Answer

    Solution

    Merging two sorted linked lists involves iterating through both lists once, comparing elements and linking them. If the lengths are m and n, the time complexity is proportional to the total number of elements, hence O(m + n).

    Practice Next
    More Data Structure Questions
    ask-question