update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
78
.config/Code/User/History/57b3d283/55T2.cpp
Normal file
78
.config/Code/User/History/57b3d283/55T2.cpp
Normal file
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
|
||||
void increaseCapacity(){
|
||||
int* newArr = new int[size*2];
|
||||
for(int j=0;j<size;j++){
|
||||
newArr[j] = customerIds[j];
|
||||
}
|
||||
delete[] customerIds;
|
||||
customerIds = newArr;
|
||||
size *= 2;
|
||||
}
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
int findCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool removeCustomer(int customerId){
|
||||
bool removed = false;
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId){
|
||||
for(int j=i;j<size-1;j++){
|
||||
customerIds[j] = customerIds[j+1];
|
||||
}
|
||||
removed = true;
|
||||
size--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
void printList(){
|
||||
for(int i=0;i<size;i++){
|
||||
cout<<customerIds[i]<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
CustomerList list;
|
||||
list.addCustomer(1);
|
||||
list.addCustomer(2);
|
||||
list.addCustomer(3);
|
||||
list.addCustomer(4);
|
||||
|
||||
list.printList();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
43
.config/Code/User/History/57b3d283/6FVY.cpp
Normal file
43
.config/Code/User/History/57b3d283/6FVY.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
|
||||
void increaseCapacity(){
|
||||
int* newArr = new int[size*2];
|
||||
for(int j=0;j<size;j++){
|
||||
newArr[j] = customerIds[j];
|
||||
}
|
||||
delete[] customerIds;
|
||||
customerIds = newArr;
|
||||
size *= 2;
|
||||
}
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
23
.config/Code/User/History/57b3d283/DkSd.cpp
Normal file
23
.config/Code/User/History/57b3d283/DkSd.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerId;
|
||||
int size;
|
||||
int capacity;
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerId = new int[capacity];
|
||||
}
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
82
.config/Code/User/History/57b3d283/GYP6.cpp
Normal file
82
.config/Code/User/History/57b3d283/GYP6.cpp
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
|
||||
void increaseCapacity(){
|
||||
int* newArr = new int[size*2];
|
||||
for(int j=0;j<size;j++){
|
||||
newArr[j] = customerIds[j];
|
||||
}
|
||||
delete[] customerIds;
|
||||
customerIds = newArr;
|
||||
size *= 2;
|
||||
}
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
int findCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool removeCustomer(int customerId){
|
||||
bool removed = false;
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId){
|
||||
for(int j=i;j<size-1;j++){
|
||||
customerIds[j] = customerIds[j+1];
|
||||
}
|
||||
removed = true;
|
||||
size--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
void printList(){
|
||||
for(int i=0;i<size;i++){
|
||||
cout<<customerIds[i]<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
CustomerList list;
|
||||
list.addCustomer(1);
|
||||
list.addCustomer(2);
|
||||
list.addCustomer(3);
|
||||
list.addCustomer(4);
|
||||
|
||||
list.removeCustomer(3);
|
||||
|
||||
cout<<list.findCustomer(4)<<endl;
|
||||
|
||||
list.printList();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
31
.config/Code/User/History/57b3d283/I9Hy.cpp
Normal file
31
.config/Code/User/History/57b3d283/I9Hy.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
49
.config/Code/User/History/57b3d283/OUSs.cpp
Normal file
49
.config/Code/User/History/57b3d283/OUSs.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
|
||||
void increaseCapacity(){
|
||||
int* newArr = new int[size*2];
|
||||
for(int j=0;j<size;j++){
|
||||
newArr[j] = customerIds[j];
|
||||
}
|
||||
delete[] customerIds;
|
||||
customerIds = newArr;
|
||||
size *= 2;
|
||||
}
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
bool removeCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
60
.config/Code/User/History/57b3d283/RDem.cpp
Normal file
60
.config/Code/User/History/57b3d283/RDem.cpp
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
|
||||
void increaseCapacity(){
|
||||
int* newArr = new int[size*2];
|
||||
for(int j=0;j<size;j++){
|
||||
newArr[j] = customerIds[j];
|
||||
}
|
||||
delete[] customerIds;
|
||||
customerIds = newArr;
|
||||
size *= 2;
|
||||
}
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
int findCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool removeCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId){
|
||||
for(int j=i;j<size-1;j++){
|
||||
customerIds[j] = customerIds[j+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
1
.config/Code/User/History/57b3d283/entries.json
Normal file
1
.config/Code/User/History/57b3d283/entries.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/C%2B%2B/DS/lab2/task4.cpp","entries":[{"id":"lMlb.cpp","timestamp":1725282148006},{"id":"DkSd.cpp","timestamp":1725282272489},{"id":"I9Hy.cpp","timestamp":1725282317389},{"id":"rAs9.cpp","timestamp":1725282378434},{"id":"6FVY.cpp","timestamp":1725282408164},{"id":"OUSs.cpp","timestamp":1725282492316},{"id":"u1CW.cpp","timestamp":1725282525027},{"id":"RDem.cpp","timestamp":1725282573728},{"id":"nBnA.cpp","timestamp":1725282614685},{"id":"n2eg.cpp","timestamp":1725283103346},{"id":"55T2.cpp","timestamp":1725283152114},{"id":"klwK.cpp","timestamp":1725283178526},{"id":"GYP6.cpp","timestamp":1725283194345}]}
|
80
.config/Code/User/History/57b3d283/klwK.cpp
Normal file
80
.config/Code/User/History/57b3d283/klwK.cpp
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
|
||||
void increaseCapacity(){
|
||||
int* newArr = new int[size*2];
|
||||
for(int j=0;j<size;j++){
|
||||
newArr[j] = customerIds[j];
|
||||
}
|
||||
delete[] customerIds;
|
||||
customerIds = newArr;
|
||||
size *= 2;
|
||||
}
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
int findCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool removeCustomer(int customerId){
|
||||
bool removed = false;
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId){
|
||||
for(int j=i;j<size-1;j++){
|
||||
customerIds[j] = customerIds[j+1];
|
||||
}
|
||||
removed = true;
|
||||
size--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
void printList(){
|
||||
for(int i=0;i<size;i++){
|
||||
cout<<customerIds[i]<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
CustomerList list;
|
||||
list.addCustomer(1);
|
||||
list.addCustomer(2);
|
||||
list.addCustomer(3);
|
||||
list.addCustomer(4);
|
||||
|
||||
cout<<list.findCustomer(4)<<endl;
|
||||
|
||||
list.printList();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
13
.config/Code/User/History/57b3d283/lMlb.cpp
Normal file
13
.config/Code/User/History/57b3d283/lMlb.cpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
71
.config/Code/User/History/57b3d283/n2eg.cpp
Normal file
71
.config/Code/User/History/57b3d283/n2eg.cpp
Normal file
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
|
||||
void increaseCapacity(){
|
||||
int* newArr = new int[size*2];
|
||||
for(int j=0;j<size;j++){
|
||||
newArr[j] = customerIds[j];
|
||||
}
|
||||
delete[] customerIds;
|
||||
customerIds = newArr;
|
||||
size *= 2;
|
||||
}
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
int findCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool removeCustomer(int customerId){
|
||||
bool removed = false;
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId){
|
||||
for(int j=i;j<size-1;j++){
|
||||
customerIds[j] = customerIds[j+1];
|
||||
}
|
||||
removed = true;
|
||||
size--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
void printList(){
|
||||
for(int i=0;i<size;i++){
|
||||
cout<<customerIds[i]<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
65
.config/Code/User/History/57b3d283/nBnA.cpp
Normal file
65
.config/Code/User/History/57b3d283/nBnA.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
|
||||
void increaseCapacity(){
|
||||
int* newArr = new int[size*2];
|
||||
for(int j=0;j<size;j++){
|
||||
newArr[j] = customerIds[j];
|
||||
}
|
||||
delete[] customerIds;
|
||||
customerIds = newArr;
|
||||
size *= 2;
|
||||
}
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
int findCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool removeCustomer(int customerId){
|
||||
bool removed = false;
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId){
|
||||
for(int j=i;j<size-1;j++){
|
||||
customerIds[j] = customerIds[j+1];
|
||||
}
|
||||
removed = true;
|
||||
size--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
33
.config/Code/User/History/57b3d283/rAs9.cpp
Normal file
33
.config/Code/User/History/57b3d283/rAs9.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
56
.config/Code/User/History/57b3d283/u1CW.cpp
Normal file
56
.config/Code/User/History/57b3d283/u1CW.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class CustomerList{
|
||||
int* customerIds;
|
||||
int size;
|
||||
int capacity;
|
||||
|
||||
void increaseCapacity(){
|
||||
int* newArr = new int[size*2];
|
||||
for(int j=0;j<size;j++){
|
||||
newArr[j] = customerIds[j];
|
||||
}
|
||||
delete[] customerIds;
|
||||
customerIds = newArr;
|
||||
size *= 2;
|
||||
}
|
||||
public:
|
||||
CustomerList() : size(0), capacity(10){
|
||||
customerIds = new int[capacity];
|
||||
}
|
||||
~CustomerList(){
|
||||
delete[] customerIds;
|
||||
}
|
||||
|
||||
void addCustomer(int customerId){
|
||||
if(size >= capacity) increaseCapacity();
|
||||
customerIds[size] = customerId;
|
||||
size++;
|
||||
}
|
||||
|
||||
int findCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
if(customerIds[i] == customerId) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool removeCustomer(int customerId){
|
||||
for(int i=0;i<size;i++){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue