我们的讲师要求我们通过以下方式将数据输入代码:
1.Random mode Run with graphs generated by random number generator. The command line for this mode is: $ mst –r n d // run in a random connected graph with n vertices and d% of density. // See Performance measurements section for details. 2.User Input mode $mst -s file-name // read the input from a file ‘file-name’ for simple scheme $mst -f file-name // read the input from a file ‘file-name’ for f-heap scheme
目前我已经编写了代码并使用g++编译了它:
g++ -o mst.o mst.cpp
我从这样的文件中获取输入:
./mst.o < data.txt
但是,我不知道如何满足上述要求。