TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhishek Jaiswal
95
19.8k
9.6m
C++ program for this algorithm
Nov 9 2013 9:15 AM
Algorithm.
(inserting into a linear array)INSERT(LA,N,K,ITEM) Here LA is a linear array with N elements and K is a positive integer such that K<=N.This algorithm inserts an element ITEM into the Kth Position in LA.
1.[Initialize counter.]set j:= N.
2.Repeat steps 3 and 4 while j >= K.
3. [Move jth element downward.] set LA[j+1] := LA [j].
4.[Decrease counter.] set j := j -1. [End of step 2 loop]
5. [insert element] set LA[K] := ITEM.
6.[Reset N] set N:=N +1 7.Exit
Reply
Answers (
1
)
i need complete C++ programs for these 2 algos
C++ program for this algo