Given an unsorted array with positive and negative elements, move all the elements to the beginning of the array.The first method to solve this problem is by sorting the array.The second method is by using the partition process of quick sort.Both methods provide the expected output, but the time complexity differs.