3 write
algorithm to insert an element in an array
Answers
Answered by
3
A is an array N is number of elements (size) Element is a data element Pos is the location of the element to be inserted. Insertion (A, N, Element, Pos) Step 1: for i = N-1 downto Pos repeat step 2 Step 2: A[i+1] = A[i] End for Step 3: A [Pos] = Element Step 4: N = N + 1
Similar questions