Executable C++ program shown in Figure Q2(c) is executing insertion and deletion algorithms by using array data structure. Write the complete output after the program execution. #include using...


Executable C++ program shown in Figure Q2(c) is executing insertion and deletion<br>algorithms by using array data structure. Write the complete output after the program<br>execution.<br>#include <iostream><br>using namespace std;<br>class InsDel<br>{<br>private:<br>int Array[];<br>public:<br>void gen_array();<br>void disp_array();<br>void insertion (int ,int );<br>void deletion (int );<br>};<br>void InsDel::gen_array ()<br>{<br>for (int i = 0; i < 8; i++)<br>{<br>Array[i] = i*2;<br>void InsDel::disp_array ()<br>for (int i = 0; i < 8; i++)<br>{<br>cout «

Extracted text: Executable C++ program shown in Figure Q2(c) is executing insertion and deletion algorithms by using array data structure. Write the complete output after the program execution. #include using namespace std; class InsDel { private: int Array[]; public: void gen_array(); void disp_array(); void insertion (int ,int ); void deletion (int ); }; void InsDel::gen_array () { for (int i = 0; i < 8;="" i++)="" {="" array[i]="i*2;" void="" insdel::disp_array="" ()="" for="" (int="" i="0;" i="">< 8;="" i++)="" {="" cout="" «="" "arr["="" «="" i="" «="" "]:="" "="" «="" array[i]="" «="" endl;="">
...Continue<br>void InsDel::insertion (int pos_insert, int val_insert)<br>int i;<br>for (i = 8-1; i > pos_insert; i--)<br>Array(i] = Array[i-1];<br>Array[i] - val_insert;<br>void InsDel::deletion (int pos_delete)<br>int i;<br>for (i = pos_delete; i < 8-1; i++)<br>{<br>Array[i] - Array[i+1];<br>Array[i] = 0;<br>int main()<br>InsDel jujukan;<br>jujukan.gen_array ();<br>jujukan.disp_array();<br>cout «

Extracted text: ...Continue void InsDel::insertion (int pos_insert, int val_insert) int i; for (i = 8-1; i > pos_insert; i--) Array(i] = Array[i-1]; Array[i] - val_insert; void InsDel::deletion (int pos_delete) int i; for (i = pos_delete; i < 8-1;="" i++)="" {="" array[i]="" -="" array[i+1];="" array[i]="0;" int="" main()="" insdel="" jujukan;="" jujukan.gen_array="" ();="" jujukan.disp_array();="" cout="" «"\n\n\n";="" cout="" «="" "insertion:="" \n";="" jujukan.insertion="" (5,100);="" jujukan.disp_array();="" cout=""><"\n\n\n"; cout=""><« "deletion:="" \n";="" jujukan.deletion="" (2);="" jujukan.disp_array();="" return="">

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here