//============================================================================
// Name : ArrayList.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
#include<array>
#include <iostream>
using namespace std;
class ArrayList{
const int max_size=10;
int array[10];
int length=0;
public:
bool isFull(){
return length==sizeof(array);
}
bool isEmpty(){
return length==0;
}
void insertEnd(int value){
if(isFull()){
cout<<"Invalid insertion: array is full";
}
else{
array[length++]=value;
}
}
void InsertAtPosition(int value, int position){
if(isFull()){
cout<<"Array is Full";
return;
}
else{
if(position==length+1){
insertEnd(value);
return;
// Name : ArrayList.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
#include<array>
#include <iostream>
using namespace std;
class ArrayList{
const int max_size=10;
int array[10];
int length=0;
public:
bool isFull(){
return length==sizeof(array);
}
bool isEmpty(){
return length==0;
}
void insertEnd(int value){
if(isFull()){
cout<<"Invalid insertion: array is full";
}
else{
array[length++]=value;
}
}
void InsertAtPosition(int value, int position){
if(isFull()){
cout<<"Array is Full";
return;
}
else{
if(position==length+1){
insertEnd(value);
return;