View Full Version : Binary Tree Help (c Lang)
petermichael
06212008, 12:58 PM
I have this task and i dont know how to do it, any help will be appreciated
I want to do it in C language under linux
Evaluate Boolean expression given by the user by using tree data structure. An example of the Boolean expression is ((X1 * X2 * X3) + (X2 * X4) + (X5))
Where * and + is not static, i mean they can be any operator.
abduraooft
06212008, 01:20 PM
I think you missed to read the forum rules (http://www.codingforums.com/rules.htm)
1.5) No homework assignments  Do not post your entire homework assignment and request that other members do it for you. This is considered cheating, and your thread may even be used by your school to prove your guilt. Now, you may ask for advice or help on a specific aspect of your assignment that you're having trouble with. Use common sense as far as what's acceptable in terms of soliciting help with homework assignments.
petermichael
06212008, 01:24 PM
My problem is with the array, sorry i missed saying that,
the problem i face is that to construct the tree i need an array containing characters and integers, how can i make 1 array that contain both?
oesxyl
06212008, 01:39 PM
My problem is with the array, sorry i missed saying that,
the problem i face is that to construct the tree i need an array containing characters and integers, how can i make 1 array that contain both?
 why do you need to mix characters and integers in same array?
 why do need a array?
you can use a union as item in array to store both type.
regards
petermichael
06272008, 10:54 AM
if you have this expression a+(b*c) how can construct a binary tree for this expression.
oesxyl
06272008, 11:24 AM
if you have this expression a+(b*c) how can construct a binary tree for this expression.
+
/ \
a ()

*
/ \
b c
http://en.wikipedia.org/wiki/Polish_notation
regards
i guse you can but your element of your expression in astack in ordere and whene you make a pop process inthesame time you can do an insertion of three
But idon't know how make it in the same time????????
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.