While inserting an item in an array of integers which loop is right, - ProProfs
Topics-
Products +
     

While inserting an item in an array of integers which loop is right, where pos is the pos at which insertion is to be made(assume array starts from 1 and N is the max no. of items in the array.)



A. For(i=pos;i>=1;i--) { A[i] = A[i+; }
B. For(i=pos ; i <= N; i++) { A[i] = A[i+; }
C. For(i=N; i>=pos;i--) { A[i] = A[i+; }
D. For(i=N; i>=pos;i--) { A[i+ = A[i] }
E. For(i=N; i<=pos;i--) { A[i+ = A[i] }

This question is part of Data Structures

+ AnswerRequest Answer
...

1 Answer

John Smith

John Smith

Answered on Jan 19, 2017

For(i=N; i>=pos;i--) { A[i+1] = A[i] }
  Reply

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.