Problem on array based list

Reply

Join Date: Feb 2006
Posts: 3
Reputation: Nurul Dee is an unknown quantity at this point 
Solved Threads: 0
Nurul Dee Nurul Dee is offline Offline
Newbie Poster

Problem on array based list

 
0
  #1
Feb 3rd, 2006
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: :-|
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,039
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: Problem on array based list

 
0
  #2
Feb 3rd, 2006
What is the problem you're having?
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,672
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 261
Lerner Lerner is offline Offline
Posting Virtuoso

Re: Problem on array based list

 
0
  #3
Feb 3rd, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 3
Reputation: Nurul Dee is an unknown quantity at this point 
Solved Threads: 0
Nurul Dee Nurul Dee is offline Offline
Newbie Poster

Re: Problem on array based list

 
0
  #4
Feb 3rd, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 3
Reputation: Nurul Dee is an unknown quantity at this point 
Solved Threads: 0
Nurul Dee Nurul Dee is offline Offline
Newbie Poster

Re: Problem on array based list

 
0
  #5
Feb 4th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 489
Reputation: Acidburn is an unknown quantity at this point 
Solved Threads: 5
Acidburn Acidburn is offline Offline
Posting Pro in Training

Re: Problem on array based list

 
0
  #6
Feb 4th, 2006
aew you trying to implement a queue?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Problem on array based list

 
0
  #7
Feb 4th, 2006
he's trying to trick people into doing his homework for him.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 43
Reputation: Nedals is an unknown quantity at this point 
Solved Threads: 0
Nedals Nedals is offline Offline
Light Poster

Re: Problem on array based list

 
0
  #8
Feb 4th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,672
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 261
Lerner Lerner is offline Offline
Posting Virtuoso

Re: Problem on array based list

 
0
  #9
Feb 6th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 43
Reputation: Nedals is an unknown quantity at this point 
Solved Threads: 0
Nedals Nedals is offline Offline
Light Poster

Re: Problem on array based list

 
0
  #10
Feb 6th, 2006
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC