 Merging two sorted lists into one can be done in linear time and linear space.The following pseudocode demonstrates an algorithm that merges input lists (either linked lists or arrays) and into a new list .The function yields the first element of a list; "dropping" an element means removing it from its list, typically by incrementing a pointer or index.