Question: Use the following code to read the two _ dimensional table from file ( PeakTable _ 1 . txtand then from PeakTable _ 2 .

Use the following code to read the two_dimensional table from file(PeakTable_1.txtand then from PeakTable_2.txt and display it as a matrix to the screen. PeakTable_2.txt has rows =97 and columns =29. PeakTable1.txt has rows =4 and columns =5.
You need to implement this question using C++ and provide a screenshot of the output.
import time
def readingMatrix() :
f = open('peakTable_2.txt','r')
list1=[]
list1=[line.split() for line in f]
return list1
def displayMatrix(theList) :
for row in range(0, len(theList)) :
for col in range(0, len(theList[0])) :
print("{0:<3}".format(theList[row][col]), end ="")
print("")
print("*** reading matrix ***")
list1= readingMatrix()
print(" # rows =", len(list1)," #cols=", len(list1[0]))
displayMatrix(list1)
Display_AllPeaks_Positions
Then you must include this:
Use the below to display the time your algorithm takes in milliseconds.
time1= time.time()
time2= time.time()
print('elapsed time:', time2- time1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!