There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer audio black screen blue screen boot computer connection crash css dell drive driver drivers email error ethernet excel explorer firefox firefox 3 hard drive internet internet explorer itunes laptop linux malware network networking outlook outlook 2003 outlook express password printer problem problems ram router security slow software sound trojan usb virus vista windows windows vista windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
i need your help...


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
mones's Avatar
Junior Member with 2 posts.
 
Join Date: Dec 2005
05-Dec-2005, 03:53 PM #1
Lightbulb i need your help...


please can any body help me and solve these qustion ..

1- write recursive function that calculates and returns the length of a linked list..

2-write a c++ code for inorderd postfix eg:-

1+2-2*6/1

and preorderd postfix using stack

+/*-12345

the user should enter the numbers and operatins

please I need the code in C++ ..

thanx..
AGCurry's Avatar
Senior Member with 431 posts.
 
Join Date: Jun 2005
Location: Kansas City area
Experience: advanced but learning
05-Dec-2005, 05:02 PM #2
Hmm, another class assignment, eh?

Okay, I'll get you started with the first one, in ANSI C syntax:

int list_length( LIST *list )
{
return( list ? 1 + list_length( list->next ) : 0 ) ;
}
blaqDeaph's Avatar
Senior Member with 869 posts.
 
Join Date: Nov 2005
Location: Down Under!
Experience: Enough
06-Dec-2005, 02:14 AM #3
First up, read up on whats postfix and whats a stack, then use a simple parsing mechanism. I'll give you a hint:

char *exp = "1+2-2*6/1"

strtok(exp, "+-*/") will return the first number, and strtok(NULL, "+-*/") will return the subsequent numbers in the string, and it will return NULL when it reaches the end of the string.
__________________
Windows XP: 64-bit wanna-be OS with a 32-bit graphical shell for 16-bit extensions of a 8-bit patch to an 4-bit operating system originally coded for a 2-bit microprocessor, written by a company that can't stand 1 bit of competition.
mones's Avatar
Junior Member with 2 posts.
 
Join Date: Dec 2005
06-Dec-2005, 01:54 PM #4
AGCurry thaaaaaaaaaaaaaaaaanx...

blaqDeaph .. I understand postfix & stack and i've tried to write the postfix but i have soooomany errors ..
I feel that my brain did't work
or there is a problem with my studing so that i can't solve ..
what should i do ...???????

i need the sol 4 tommorw ..

next time i'll try to solve some problems here but you will be my teacher and correct them
blaqDeaph's Avatar
Senior Member with 869 posts.
 
Join Date: Nov 2005
Location: Down Under!
Experience: Enough
08-Dec-2005, 02:48 AM #5
Well, post the code that you have so far?
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:49 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.