You are on page 1of 1

Data Structure ( Unit – 1 )

Traversal (A, LB, UB) A is an array with Lower Bound LB and Upper Bound UB.

Step 1: for LOC = LB to UB do

Step 2: Apply PROCESS to A [LOC]

[End of for loop]

Step 3: Exit

Insert (A, N, ITEM, Pos) A is an array with N elements. ITEM is the element to be

inserted in the position Pos.

Step 1: for I = N-1 down to Pos

A[ I + 1] = A[I]

[End of for loop]

Step 2: A [Pos] = ITEM

Step 3: N = N+1

Step 4: Exit

Delete (A, N, ITEM, Pos) A is an array with N elements. ITEM is the element to be

deleted in the position Pos and it is stored into variable Item.

Step 1: ITEM = A [Pos]

Step 2: for I = Pos down to N-1

A[ I ] = A[I+1]

[End of for loop]

Step 3: N = N-1

Step 4: Exit

Prof. Arpita R. Ojha Page 1

You might also like