Need help with 1, especially about putting the data from the input file into an
ID: 3871058 • Letter: N
Question
Need help with 1, especially about putting the data from the input file into an array.
myFSU-Central Authen × y Hw2_cop 4531.pdf × de Count Inversions in an a × Chegg Study Guided S × Recall The Problem Of F × 1. Given A Non Sorted A C | www.cs.fsu.edu/~tvhoang/classes/Hw2cop453 1.pdf Apps New Tab Online Derivative Ca M ITSDocs: Create, Cop In Unik, how do I list db vi/vim notesIn Unix, how do I cha C-String Password-Introduction to OOP Implementing Sieve Hw2 cop4531.pdf 1. (15 points) Implement Counting Inversion algorithm to compute the number of inversions in an Integer rray. Your program should run in n log time; brute-force implementation will receive no credit. We shall testyour program with large n, in particular, the number of inversions may exceed the range of 32-bit integers, so make sure that you won't have overflow by using an appropriate data type Input: The input is a text file, containing the array size and the array elements. Your program will take the file name as an argument and read it Input Format: The first line contains the size of the array, namely . Starting from the second line the array elements are glven, one element per line. We provide some sample input and output files, in CI_Input_Output.2ip. Below are the details about the input size in the sample files CI.teatl.txt: n8 cI teat2.txt: 432,000; CI test3.txt: n 25 x 10 Output: The output is an integer representing the total number of inversions in the input array 2. (30 points) Implement Closest Pair of Points. To get full credit, your program should run in O(n log(n)) time, as the last test case will be very large. If your program runs with (nlog(n you wll still get 80% credit of this task. Again. brute-force implementation shall receive no credit. Input: The input is a text file containing the total number of points and the (X, Y) coordinates of all points. Your program will take the file name as an argumen, and read You can assume that the input has no degeneracy, namely no two points have the same X-coordinate. Input Format: The first line contains the total nber of points, namely n. Starting from the second line, each line gives the X-and Y-coordinate of a single point, separated by a space. We provide some sample input and output files, in CP_Input_Output.zip. Below are the details about the input size in the sample files. CPtest1. txt : n= 5: CPtest2.txt : n= 1000: CPtest3.txt: n= 107 ad - - - Output: The distance between a closest pair. 1 2-1Explanation / Answer
C ++ program to find the file placed into an array
o/p :here we will get the data from that file what ever the content is present