Jump to content

Assistance with the Implementation of ADT Abstract Data Type

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
mibit

mibit

    Newbie

  • Members
  • Pip
  • 7 posts
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:

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
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.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
lucuis

lucuis

    Newbie

  • Members
  • PipPip
  • 21 posts
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.