Wrox Programmer Forums
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 29th, 2007, 05:43 PM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default data structures problems

Hi everyone.... I have to write my homework now, but unfortunately I don't know how:( and I don't have much time...So I was wondering if someone can help me...
1. I have two lists, L1 and L2. I should write a function that will join these lists in one....
e.g. L1={a,b,c} , L2={b,e} and the result should look like L1={a,b,c,b,e}
2.I should write a function which the given list L will print it in reverse form
e.g. L={a,b,c} should look like c,b,a
3. I should write a function which will find the sum of the elements of the given list L
e.g L={3,11,5} ...and the sum should be 19
Thank you in advance

2305985
Reply With Quote
  #2 (permalink)  
Old April 11th, 2007, 11:27 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 103
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Geo121
Default

Seeing how it has been almost 13 days i would guess that you have determined that no one will do your homework for you...

This is because we are here to help not do it for you...

Given your problems I will tell you what to do since your homework is most likely late and it will only be TELLING you what to do not doing it for you please remember if you need help dont ask someone to do it for you...

try it yourself and ask us what you did wrong...

1. simple - make a function that accepts two pointers (list1, list2) now take the values and use a for loop to add the values to a new list (array)

2. even simpler - create a function that accepts one pointer (list1) and use the getLength function of the array to find the end and use a for loop to display each value until you reach 0

3. simplest - create a function that accepts one pointer (list1) use getLength to find the number of elements so you know when to stop and use a for loop to add to a variable that holds the total

There you are...

I know its late and its not the "answers" but I shoulddnt have even told you this please...

from now on, post your code

~ Geo

~ Don't take life too seriously, you'll never get out alive!
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Topics needed in Data Structures c.vikramnarayan C++ Programming 1 June 19th, 2009 09:56 PM
Algorithms Data Structures p0120144 C++ Programming 3 March 25th, 2006 08:34 AM
data structures silvia C# 4 January 19th, 2006 04:25 AM
Complex Data Structures misterqj General .NET 2 March 19th, 2005 04:40 AM
data structures in C# Xanoo C# 4 July 1st, 2004 03:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.