944,144 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 3154
  • C RSS
Feb 3rd, 2006
0

Problem on array based list

Expand Post »
i have a problem to simulate program on array-based list :rolleyes: .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: :-|
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Nurul Dee is offline Offline
3 posts
since Feb 2006
Feb 3rd, 2006
3

Re: Problem on array based list

What is the problem you're having?
Team Colleague
Reputation Points: 1135
Solved Threads: 173
Super Senior Demiposter
Rashakil Fol is online now Online
2,479 posts
since Jun 2005
Feb 3rd, 2006
0

Re: Problem on array based list

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.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Lerner is offline Offline
2,253 posts
since Jul 2005
Feb 3rd, 2006
0

Re: Problem on array based list

Quote originally posted by Rashakil Fol ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Nurul Dee is offline Offline
3 posts
since Feb 2006
Feb 4th, 2006
0

Re: Problem on array based list

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Nurul Dee is offline Offline
3 posts
since Feb 2006
Feb 4th, 2006
0

Re: Problem on array based list

aew you trying to implement a queue?
Reputation Points: 12
Solved Threads: 5
Posting Pro
Acidburn is offline Offline
510 posts
since Dec 2004
Feb 4th, 2006
0

Re: Problem on array based list

he's trying to trick people into doing his homework for him.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Feb 4th, 2006
0

Re: Problem on array based list

Quote originally posted by Lerner ...
This is going to involve a lot of shifting of values stored in the array.....
Or you could use a linked list.
Reputation Points: 11
Solved Threads: 0
Light Poster
Nedals is offline Offline
43 posts
since Dec 2005
Feb 6th, 2006
0

Re: Problem on array based list

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.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Lerner is offline Offline
2,253 posts
since Jul 2005
Feb 6th, 2006
0

Re: Problem on array based list

Quote originally posted by Nurul Dee ...
....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.
Reputation Points: 11
Solved Threads: 0
Light Poster
Nedals is offline Offline
43 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Benchmark
Next Thread in C Forum Timeline: hw to find large value in a array without using IF STATEMENT





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC