On Jan 4, 2016 11:00 AM, "Pooja Bhalode" <poojabhalod...@gmail.com> wrote: > > Hi, I wanted to check if this program can be used to merge the lists > together and sort them. This seems to work, but i wanted to check if there > are drawbacks in writing it in this manner.
You may be missing some important details or misunderstanding a crucial detail. For example, the term "merge" in this context usually had a very specific technical meaning. Are your two input lists already sorted? The use of the term "linear" in the function definition: > def linear_merge(list1, list2): has a particular meaning in terms of algorithmic complexity, and the first implementation does not satisfy it: it does not perform linearly due to the internal use of the sort(). If you have questions, please feel free to ask. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor