Argh.. help..0_0
I've gota bit of a conundrum here... I'm not that clear with I/O Streams and Search algorithms (well not too clear with OOP yet anyway..)
I have to write a couple of things...
The algorithms that have to be compared are:
1. Linear search
2. Binary search
Given Information:
Input File
There are two input files named Array_A.txt and Array_B.txt
1. The Array_A.txt input file contains 3 datasets each of different size. The size of the datasets will be 10, 100 and 1000. The start of each dataset will provide a number n indicating the size of the dataset, followed by integers organized randomly in a subset.
3. The Array_B.txt file contains three datasets of size 5, 10 and 100. The start of each dataset will provide a number n indicating the size of the dataset, followed by integers organized randomly in a subset.
Tasks:
1. For each dataset in Array_A.txt file create an array to store the integers of the dataset. The arrays may be named as A1, A2 and A3.
2. For each dataset in Array_B.txt file create an array to store the integers of the dataset. The arrays may be named as B1, B2, B3
3. Search Arrays A1, A2, and A3 for values in corresponding arrays B1, B2 and B3, by calling the two different algorithms.
Search A1 for each value in B1 and record the number of comparisons involved in searching. Find the average to get a measure of the performance.
You need to run both Linear search and Binary search and record the performance of each algorithm separately.
1. The step count of the search may be recorded in a file or printed out as hard copy
2. Performance is to be measured by finding the number of times comparisons are done within the search function. A counter needs to be used for this purpose
5. Graph your results using Excel. Compare the graphs and write a brief analysis on the results and performance of the algorithms.
--
I'm confused as to how to even START this thing, not to mention write it out... >.> it's a wee bit like rocket science to me at this stage....
I have to write a couple of things...
The algorithms that have to be compared are:
1. Linear search
2. Binary search
Given Information:
Input File
There are two input files named Array_A.txt and Array_B.txt
1. The Array_A.txt input file contains 3 datasets each of different size. The size of the datasets will be 10, 100 and 1000. The start of each dataset will provide a number n indicating the size of the dataset, followed by integers organized randomly in a subset.
3. The Array_B.txt file contains three datasets of size 5, 10 and 100. The start of each dataset will provide a number n indicating the size of the dataset, followed by integers organized randomly in a subset.
Tasks:
1. For each dataset in Array_A.txt file create an array to store the integers of the dataset. The arrays may be named as A1, A2 and A3.
2. For each dataset in Array_B.txt file create an array to store the integers of the dataset. The arrays may be named as B1, B2, B3
3. Search Arrays A1, A2, and A3 for values in corresponding arrays B1, B2 and B3, by calling the two different algorithms.
Search A1 for each value in B1 and record the number of comparisons involved in searching. Find the average to get a measure of the performance.
You need to run both Linear search and Binary search and record the performance of each algorithm separately.
1. The step count of the search may be recorded in a file or printed out as hard copy
2. Performance is to be measured by finding the number of times comparisons are done within the search function. A counter needs to be used for this purpose
5. Graph your results using Excel. Compare the graphs and write a brief analysis on the results and performance of the algorithms.
--
I'm confused as to how to even START this thing, not to mention write it out... >.> it's a wee bit like rocket science to me at this stage....
