Library 2

0 errors in simpletest
This commit is contained in:
Alessandro Ferro 2021-04-19 15:44:27 +02:00
parent 15e341a6a0
commit 3fdd2e86cb
5 changed files with 18 additions and 23 deletions

Binary file not shown.

View File

@ -12,13 +12,13 @@ QueueVec<Data>::QueueVec(){
template <typename Data> template <typename Data>
QueueVec<Data>::QueueVec(const LinearContainer<Data>& linear){ QueueVec<Data>::QueueVec(const LinearContainer<Data>& linear){
size = linear.Size(); size = linear.Size()+1;
Elements = new Data[size+1]; //forse da espandere Elements = new Data[size]; //forse da espandere
for(ulong i=0 ; i<linear.Size() ; ++i){ for(ulong i=0 ; i<linear.Size() ; ++i){
Elements[i] = linear[i]; Elements[i] = linear[i];
} }
front = 0; front = 0;
rear = size; // the vector will be full rear = size-1; // the vector will be full
} }
template <typename Data> template <typename Data>

View File

@ -37,13 +37,21 @@ void menu(){
QueueLst<int> q2; // QueueLst<int> q2;
q2 = std::move(q1); // q2 = std::move(q1);
//
// q2.HeadNDequeue();
// q2.HeadNDequeue();
// q2.HeadNDequeue();
// q2.HeadNDequeue();
// q2.HeadNDequeue();
q2.HeadNDequeue();
q2.HeadNDequeue(); QueueVec<int> quevec;
q2.HeadNDequeue(); quevec.Enqueue(0);
q2.HeadNDequeue(); quevec.Enqueue(1);
q2.HeadNDequeue(); QueueVec<int> newquevec = quevec;
if(quevec == newquevec) std::cout<<"uguali";
} }

Binary file not shown.

View File

@ -1,13 +0,0 @@
#include<iostream>
using namespace std;
ulong Size(){
ulong a = 6;
return a;
}
int main(){
ulong j = Size();
cout<<j<<endl;
for(long int x=(long int)Size() ; x>=0 ; --x){
cout<<x<<endl;
}
}