Exemplo n.º 1
0
int main()
{
	int a[c];
	time_t seconds;
	time(&seconds);
	srand((unsigned int) seconds);
	inputa(a);
	outputa(a);
	cout<<endl;
	dosort(a);
	outputa(a);
	search(a);
	return 0;
}
Exemplo n.º 2
0
			static void mergeFiles(
				std::string const & filenamea,
				std::string const & filenameb,
				std::string const & outputfilename
				)
			{
				::libmaus2::graph::TripleEdgeInput inputa(filenamea,32*1024);
				::libmaus2::graph::TripleEdgeInput inputb(filenameb,32*1024);
				::libmaus2::graph::TripleEdgeOutputMerge output(outputfilename, 32*1024);

				::libmaus2::graph::TripleEdge triplea;
				::libmaus2::graph::TripleEdge tripleb;
				bool oka = inputa.getNextTriple(triplea);
				bool okb = inputb.getNextTriple(tripleb);

				while ( oka && okb )
				{
					if ( triplea < tripleb )
					{
						output.write(triplea);
						oka = inputa.getNextTriple(triplea);
					}
					else
					{
						output.write(tripleb);
						okb = inputb.getNextTriple(tripleb);
					}
				}

				while ( oka )
				{
					output.write(triplea);
					oka = inputa.getNextTriple(triplea);
				}

				while ( okb )
				{
					output.write(tripleb);
					okb = inputb.getNextTriple(tripleb);
				}
			}