educative.io

Educative

Insert() suggestion

Sorry, I couldn’t find a link to make a suggestion for this lesson, but the Insert() code would look better like this:
void insert(int val) {
if(num_elements >= capacity) {
resize();
}
arr[num_elements]=val;
num_elements++;
}


Type your question above this line.

Course: https://www.educative.io/collection/5642554087309312/5646276079124480
Lesson: https://www.educative.io/collection/page/5642554087309312/5646276079124480/5745493850193920

Hi @Jorge_Amengol

Yes solution for the given problem seems fine. Thanks you for the valuable feedback.

Regards,
Dian Us Suqlain