PA of Algorithms Q29

0. The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of a list should be used?

  • Option : C
  • Explanation :

    Algo for concatenation is ⇒
    {
    t1 = S1 → nxt ;
    t2 = S2 → nxt ;
    t1 → nxt = S2
    t2 → nxt = S1
    S1 → nxt = t2
    S2 → nxt = t1
    }
    it is sequential alqoni them so complexity is O(1)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *