954,492 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem on array based list

i have a problem to simulate program on array-based list :rolleyes: :sad: .The array can store 10 integer value.The application should be perform basic operation such as inserting,deleting and displaying the array's content :rolleyes: .Any extra operation are welcome.The application should promt user a menu as follow :

1)insert value
2)delete value
3)display value
4)exit

you are free to perform either forward or backword approach for inserting process.for deleting purpose: remove the most front element in the list.

Plez help me ur guys :) :cry: :-|

Nurul Dee
Newbie Poster
3 posts since Feb 2006
Reputation Points: 10
Solved Threads: 0
 

What is the problem you're having?

Rashakil Fol
Super Senior Demiposter
Team Colleague
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
 

This is going to involve a lot of shifting of values stored in the array. You will end up shifting to the left when deleting any element other than the last one, and shifting to right when you add at any element but the last one. To shift to the left you shift the left most element to be shifted first, and then work to the right. To shift to the right you move the right most element to be shifted first and then work to the left. If you can figure out how to insert and delete from the first element of the array, you will probably have an easier time inserting between elements.

Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
 
What is the problem you're having?

i have a problem to simulate program on array-based list .The array can store 10 integer value.The application should be perform basic operation such as inserting,deleting and displaying the array's content .Any extra operation are welcome.The application should promt user a menu as follow :

1)insert value
2)delete value
3)display value
4)exit

you are free to perform either forward or backword approach for inserting process.for deleting purpose: remove the most front element in the list.

Plez help me ur guys

Nurul Dee
Newbie Poster
3 posts since Feb 2006
Reputation Points: 10
Solved Threads: 0
 

i have a problem to simulate program on array-based list .The array can store 10 integer value.The application should be perform basic operation such as inserting,deleting and displaying the array's content .Any extra operation are welcome.The application should promt user a menu as follow :

1)insert value
2)delete value
3)display value
4)exit

you are free to perform either forward or backword approach for inserting process.for deleting purpose: remove the most front element in the list.

Plez help me ur guys

i dont know if i break the rules @ not by asking u guys this question.i just can make it 1/2 way je.the problem is i dont know how to use the forward @ backward corectly.i hope u guys can help me.I ask for help with hope i can learn something from u guys.Plez help me..thank you may god bless u and may u have a nice day

Nurul Dee
Newbie Poster
3 posts since Feb 2006
Reputation Points: 10
Solved Threads: 0
 

aew you trying to implement a queue?

Acidburn
Posting Pro
511 posts since Dec 2004
Reputation Points: 12
Solved Threads: 5
 

he's trying to trick people into doing his homework for him.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
This is going to involve a lot of shifting of values stored in the array.....


Or you could use a linked list.

Nedals
Light Poster
43 posts since Dec 2005
Reputation Points: 11
Solved Threads: 0
 

I suspect the ultimate purpose of doing this exercise is to have the novice programmere experience for themselves the benefits of using pointers by having them add/delete/read forward/read backward from an array first and then show them how "easy" it is to do it with pointers and a list. At least that what is assume the original poster meant when saying:

i have a problem to simulate program on array-based list.

Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
 
....i just can make it 1/2 way je....


Post what you have so far and you will be much more likely to get some help.

Nedals
Light Poster
43 posts since Dec 2005
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You