Technology, Web & Business Forum

You are here: Technology, Web & Business Forum : Network Management : Unified Communications : This is a Data Structure question ( linked lists) can anyone help?


Welcome to the Technology, Web & Business Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.


Unified Communications Topics related to network conferencing technologies for audio and video


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-28-2008
Junior Member
 
Join Date: Mar 2008
Posts: 1
Default This is a Data Structure question ( linked lists) can anyone help?

What is the output of these statements, using your sequence ADT implemented as a linked list with Item defined as integer:
sequence x;
sequence y;
x.insert(41); // Inserts 41 into the sequence x
x.insert(42); // Inserts 42, so that x is now 42, 41 with cursor at front
y = x;
x.attach(43); // Attaches 43 so that x is now 42, 43, 41 with cursor at 43
y.advance( );
cout << "y size is " << y.size( );
cout << " and y current item is " << y.current( ) << endl;

A. y size is 2 and y current item is 41.
B. y size is 2 and y current item is 43.
C. y size is 3 and y current item is 41.
D. y size is 3 and y current item is 43.
E. None of the above.
__________________
Powered by Yahoo! Answers
Reply With Quote
  #2 (permalink)  
Old 03-30-2008
Junior Member
 
Join Date: Mar 2008
Posts: 1
Default

I don't have your sequence ADT implemented as a linked list, but if I were to take an educated guess, C would have to be the answer.
__________________
Powered by Yahoo! Answers
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 04:48 AM.