1Last Semester PEQ1: Where to Insert X?First, you are presented with a number L, (1 <= L <= 1,000,000).Then, you are given an UNSORTED list of L non-negative (>=0)32-bit integers (232 - 1). (You will need to sort this list first.)Then, a number Q follows, which represent Q queries,(1 <= Q <= 10,000).Next, Q lines follow.For each line, you will see an integer X.We want to insert this X into the SORTED list of these L integersin such a way that if we insert X into that index, the insertionwill not cause the resulting list to be unsorted.Where to Insert X?The answer for each query is an integer in one line that tells the FIRST INDEX of the proper insertion point of X in this format:"The insertion index is : <THE_INDEX>"•If you do linear search on the sorted list to find the insertion point, you will fail some of the cases.

This
preview
has intentionally blurred sections.
Sign up to view the full version.