Homework Definition: Merging two arrays which are given in files using queues and a stack. User will enter three files names to run the program from terminal. First two parameters will represent input file’s names and last parameter will be the file name which will include merged struct’s content. (First two input files are attached.) .
./odev [login to view URL] [login to view URL] [login to view URL]
First two files include sorted numbers. These numbers are ordered decreasingly. The purpose is to merge these numbers increasingly. The numbers in “[login to view URL]” will be read and these numbers will be pushed in a queue called
Q1. Then similarly, numbers in “[login to view URL]” will be read and these numbers will be pushed in a queue called Q2. After this, these queues will be popped and merged into a stack in a sorted way. At the end of merging, the bottom of the stack must include the number with the highest value, and the top of the stack must include the smallest one. If you read equal values from queues, you should push one of them to the stack. At the end of the program,
you will pop from the stack and write these values to the “[login to view URL]”. Also, you should print out your queues’ and the stack’s content to the screen as follows;
Q1={555555, 444, 33}
Q2={5000, 1344, 130, 123, 56, 33, 22, 11}
S={11, 22, 33, 56, 123, 130, 444, 1344, 5000, 555555}
Note that number 33 is included once in the stack.