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


    Question

    What is the time complexity for inserting a node at the

    end of a singly linked list if you only have a pointer to the head?
    A O(1) Correct Answer Incorrect Answer
    B O(log n) Correct Answer Incorrect Answer
    C O(n) Correct Answer Incorrect Answer
    D O(n log n) Correct Answer Incorrect Answer
    E O(n^2) Correct Answer Incorrect Answer

    Solution

    O(n)

    Practice Next
    ask-question