Could you please help me with the source code for the following Task:
implement an ADT for manage a sequence through a restricted set of the following functions: size(), get_first(), remove_first(), insert_first() and insert_last(). Design and implement an algorithm for reversing a sequence using only the above functions. The algorithm should rearange the elements of the sequence. Another sequence may be used for auxilary storage.
THANK you aLL :w00t: :w00t: :w00t:
Assistance with the Implementation of ADT Abstract Data Type
Started by mibit, Nov 17 2008 10:58 PM
2 replies to this topic
#1
Posted 17 November 2008 - 10:58 PM
|
|
|
#2
Posted 18 November 2008 - 06:07 AM
There are two distinct problems stated here, and you haven't specified the language.
1) implement an ADT for manage a sequence through a restricted set of the following functions: size(), get_first(), remove_first(), insert_first() and insert_last(). You may want to specify whether get_first() modifies the data or not. What do you have so far? At the very least, providing the function declarations and the internal memory structure shouldn't be hard.
2) Design and implement an algorithm for reversing a sequence using only the above functions. The algorithm should rearange the elements of the sequence. Another sequence may be used for auxilary storage. You cannot even begin doing this until part 1 is complete. Once done, it should be easy. Again, share your ideas and we can help you firm them into a workable solution.
1) implement an ADT for manage a sequence through a restricted set of the following functions: size(), get_first(), remove_first(), insert_first() and insert_last(). You may want to specify whether get_first() modifies the data or not. What do you have so far? At the very least, providing the function declarations and the internal memory structure shouldn't be hard.
2) Design and implement an algorithm for reversing a sequence using only the above functions. The algorithm should rearange the elements of the sequence. Another sequence may be used for auxilary storage. You cannot even begin doing this until part 1 is complete. Once done, it should be easy. Again, share your ideas and we can help you firm them into a workable solution.
#3
Posted 18 November 2008 - 07:51 AM
Hello. Singly-linked list will fit this ADT decription. See singly-linked list tutorial for details.
Edited by lucuis, 18 November 2008 - 09:31 AM.


Sign In
Create Account

Back to top









