Algorithms for Addition and Sorting
Algorithms for Addition and Sorting
Assume, we have an array ARR with length N. We want to search a value K in the array.
Step 1: Set J = 0
Step 2: Set I = 0
Step 3: J = J + 1
Step 4: Print “Found”
Step 5: If A<B then
Print A
Else if B<C then
Print B
Else
Print C
Step 6: Repeat steps 7 to 9 while I<N-1
Step 7: Print I
Step 8: I = I+1
Step 9: If I < 10 then
Print N
Step 10: Call SWAP(ARR[J], ARR[J+1])
ARR[J] == K