1 C++ Classes and Data Structures Jeffrey S. Childs Chapter 2 Overloaded Operators, Class Templates, and Abstraction Jeffrey S. Childs Clarion University of PA © 2008, Prentice Hall
2 Binary Operators A binary operator acts upon two operands x + ax + a binary operator operands
3 Overloaded Operators The operands can be constants, variables, or objects If one or more of the operands are objects, the operator must be an overloaded operator An overloaded operator calls a function, which carries out the operation
4 1 struct CarType { 2string maker; 3int year; 4float price; 5bool operator >( int num ) 6{ if ( price > num ) return true; return false; } 6 }; 7 8 int main( ) 9 { 10CarType myCar;. 16if ( myCar > 2000 ) 17cout << “My car is more than 2000!” << endl; 18return 0; 19 } Example
5 The Function Call “myCar > 2000” is the function call The operator > function is called for the myCar object The right operand is always passed as a parameter into the function
6 1 struct CarType { 2string maker; 3int year; 4float price; 5bool operator >( int num ) 6{ if ( price > num ) return true; return false; } 6 }; 7 8 int main( ) 9 { 10CarType myCar;. 16if ( myCar > 2000 ) 17cout << “My car is more than 2000!” << endl; 18return 0; 19 } Right Operand
7 1 struct CarType { 2string maker; 3int year; 4float price; 5bool operator >( int num ) 6 { if ( price > num ) return true; else return false; } 7bool operator >( CarType car ) 8 { if ( price > car.price ) return true; else return false; } 9 }; Adding Another Overloaded Operator > for “myCar > yourCar”
8 struct CarType { string maker; int year; float price; bool operator >( int num ) { if ( price > num ) return true; else return false; } bool operator >( CarType car ) { if ( price > car.price ) return true; else return false; } float operator +( CarType car ) { return price + car.price; } }; Adding an Overloaded Operator + for “myCar + yourCar”
9 Where to Place Overloaded Operator Functions If the left operand is an object of a struct, place the overloaded operator within the struct definition (as shown previously) If the left operand is not an object, place the overloaded operator directly underneath the struct definition
10 struct CarType { string maker; int year; float price;. float operator +( CarType car ) { return price + car.price; } }; bool operator <( int num, CarType car ) { if ( num < car.price ) return true; else return false; } Adding an Overloaded Operator for “2000 < myCar”
11 struct Check { float checkAmount; int checkNum; string date; string receiver; }; A Check Struct for the Checkbook Class (to Replace float)
12 class Checkbook { public: void setBalance( float amount ); bool writeCheck( float amount ); void deposit( float amount ); float getBalance( ); float getLastCheck( ); float getLastDeposit( ); private: float balance; float lastCheck; float lastDeposit; }; The First Class
13 class Checkbook { public: void setBalance( float amount ); bool writeCheck( Check amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; The Second Class Check struct placed here Necessary, so the compiler knows what “Check” is
14 Class Templates Instead of making different classes for different data types, we can make one class template. A class template is a blueprint for making a class. The client uses one line of code to have the compiler make a class from the class template. The client can make his/her own Check struct for the Checkbook, and place it in the main program.
15 class Checkbook { public: void setBalance( float amount ); bool writeCheck( Check amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template Check struct placed here First, we don’t need the Check struct here – the client can make it the way they want in the main program (the compiler will see it before it makes the class)
16 class Checkbook { public: void setBalance( float amount ); bool writeCheck( Check amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.)
17 class Checkbook { public: void setBalance( float amount ); bool writeCheck( Check amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.) Now, we need a special line of code to tell the compiler this is a class template
18 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( Check amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.) Now, we need a special line of code to tell the compiler this is a class template
19 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( Check amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.) you can think of DataType as a “variable name” for a data type – its value can be “float” or “Check” or anything else the client would like it to be
20 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( Check amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.) Now, since we are using a more general DataType, we use it for the type wherever appropriate
21 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( Check amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.)
22 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( DataType amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.)
23 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( DataType amount ); void deposit( float amount ); float getBalance( ); Check getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.)
24 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( DataType amount ); void deposit( float amount ); float getBalance( ); DataType getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.)
25 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( DataType amount ); void deposit( float amount ); float getBalance( ); DataType getLastCheck( ); float getLastDeposit( ); private: float balance; Check lastCheck; float lastDeposit; }; Making a Class Template (cont.)
26 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( DataType amount ); void deposit( float amount ); float getBalance( ); DataType getLastCheck( ); float getLastDeposit( ); private: float balance; DataType lastCheck; float lastDeposit; }; Making a Class Template (cont.)
27 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( DataType amount ); void deposit( float amount ); float getBalance( ); DataType getLastCheck( ); float getLastDeposit( ); private: float balance; DataType lastCheck; float lastDeposit; }; Making a Class Template (cont.) Finally, we add a line to include the implementation file (not done in an ordinary class)
28 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( DataType amount ); void deposit( float amount ); float getBalance( ); DataType getLastCheck( ); float getLastDeposit( ); private: float balance; DataType lastCheck; float lastDeposit; }; #include “checkbook.cpp” Making a Class Template (cont.) Finally, we add a line to include the implementation file (not done in an ordinary class)
29 template class Checkbook { public: void setBalance( float amount ); bool writeCheck( DataType amount ); void deposit( float amount ); float getBalance( ); DataType getLastCheck( ); float getLastDeposit( ); private: float balance; DataType lastCheck; float lastDeposit; }; #include “checkbook.cpp” Making a Class Template (cont.) The client can also have the compiler make more than one class from the class template, each having a different type for DataType
30 18 template 19 void Checkbook ::setBalance( float amount ) 20 { 21balance = amount; 22 } The Implementation File for a Class Template In a class template, we don’t include the class specification file at the top of the implementation file.
31 23 template 24 bool Checkbook ::writeCheck( DataType amount ) 25 { 26if ( amount > balance ) 27return false; 28balance -= amount; 29lastCheck = amount; 30return true; 31 } The Implementation File for a Class Template (cont.)
32 23 template 24 bool Checkbook ::writeCheck( DataType amount ) 25 { 26if ( amount > balance ) 27return false; 28balance -= amount; 29lastCheck = amount; 30return true; 31 } The Implementation File for a Class Template (cont.) If the client wants to use a Check struct for DataType, we have some overloaded operators here…
33 23 template 24 bool Checkbook ::writeCheck( DataType amount ) 25 { 26if ( amount > balance ) 27return false; 28balance -= amount; 29lastCheck = amount; 30return true; 31 } The Implementation File for a Class Template (cont.) struct assignment is allowed
34 32 template 33 void Checkbook ::deposit( float amount ) 34 { 35balance += amount; 36lastDeposit = amount; 37 } template 40 float Checkbook ::getBalance( ) 41 { 42return balance; 43 } The Implementation File for a Class Template (cont.)
35 61 template 62 DataType Checkbook ::getLastCheck( ) 63 { 64return lastCheck; 65 } template 68 float Checkbook ::getLastDeposit( ) 69 { 70return lastDeposit; 71 } The Implementation File for a Class Template (cont.)
36 // checkbook.h – a class template for a Checkbook, where the // check is any data type // to use an object for the DataType, overload the following // operators: //>left operand: objectright operand: float //used to compare the amount of the check in the // struct object with the balance //-=left operand: floatright operand: object //used to subtract the amount of the check in the //struct object from the balance Example of Comments for a Class Template Place these comments above the class template
37 1 #include 2 #include 3 #include 4 #include "checkbook.h" 5 6 using namespace std; Program Using the Class Template Needed in the main program for both classes and class templates
38 7 struct MyCheck { 8float amt; 9int checkNum; 10string checkComment; 11bool operator >( float bal ) 12{ if ( amt > bal ) return true; return false; } 13 }; void operator -=( float & bal, MyCheck ch ) 16{ bal -= ch.amt; } Program Using the Class Template (cont.) from writeCheck: 26 if ( amount > balance ) from writeCheck: 28 balance -= amount;
39 17 int main( ) 18{ 19Checkbook johnsCheckbook; 20Checkbook susansCheckbook; 21 22MyCheck susansCheck; 23float amount; 24bool johnsCheckAccepted = false, 25susansCheckAccepted = false; Program Using the Class Template (cont.)
40 26johnsCheckbook.setBalance( 1000 ); 27susansCheckbook.setBalance( 2000 ); 28 29cout << "John, your balance is $ " << endl; 30cout << "Susan, your balance is $ " << endl; Program Using the Class Template (cont.)
41 31cout << "John, enter your check amount: $"; 32cin >> amount; 33if ( johnsCheckbook.writeCheck( amount ) ) { 34cout << "Your check was accepted." << endl; 35johnsCheckAccepted = true; 36} 37else 38 cout << 39 “Check amount is higher than balance” << endl; Program Using the Class Template (cont.)
42 40cout << "Susan, enter the check number for your check: "; 41cin >> susansCheck.checkNum; 42cin.ignore( ); 43cout << "Please also enter any comment you wish” << 44“ to make about the check: “ << endl; 45getline( cin, susansCheck.checkComment ); 46cout << "Susan, enter your check amount: $"; 47cin >> susansCheck.amt; Program Using the Class Template (cont.)
43 48if ( susansCheckbook.writeCheck( susansCheck ) ) { 49cout << "Your check was accepted." << endl; 50susansCheckAccepted = true; 51} 52else 53 cout << 54 “Check amount is higher than balance” << endl; Program Using the Class Template (cont.)
44 55cout << fixed << showpoint << setprecision( 2 ); 56cout << "John, your balance is: $" << 57johnsCheckbook.getBalance( ) << endl; 58if ( johnsCheckAccepted ) 59cout << "Your last check amount is: $" << 60johnsCheckbook.getLastCheck( ) << endl; 61cout << "Susan, your balance is: $" << 62susansCheckbook.getBalance( ) << endl; Program Using the Class Template (cont.)
45 63if ( susansCheckAccepted ) { 64MyCheck testSusansCheck; 65testSusansCheck = susansCheckbook.getLastCheck( ); 66cout << "Your last check amount was: $" << 67 testSusansCheck.amt << endl; 68cout << "for check number: " << 69testSusansCheck.checkNum << endl; 70cout << "with check comment: " << 71testSusansCheck.checkComment << endl; 72} 73 74return 0; 75 } Program Using the Class Template (cont.)
46 Stack A stack is a data structure It is like a stack of plates, except it is a stack of data It can be a stack of int’s, a stack of float’s, a stack of strings, a stack of struct objects, etc. –why class templates are used for data structures
47 Push Push means place a new data element at the top of the stack
48 Push (cont.) Push means place a new data element at the top of the stack
49 Push (cont.) Push means place a new data element at the top of the stack
50 Push (cont.) Push means place a new data element at the top of the stack
51 Pop Pop means take a data element off the top of the stack
52 Pop (cont.) Pop means take a data element off the top of the stack
53 Pop (cont.) Pop means take a data element off the top of the stack
54 Pop (cont.) Pop means take a data element off the top of the stack
55 Peek Peek means retrieve the top of the stack without removing it
56 Peek (cont.) Peek means retrieve the top of the stack without removing it
57 Peek (cont.) Peek means retrieve the top of the stack without removing it
58 Abstraction Abstraction occurs when we use something without thinking about the details of how it works –Driving a car –The string class An abstract data type (ADT) is a data type that contains both data and functions (operations on data); we use the functions without thinking about how they work The stack is an abstract data type Abstraction makes large program development much easier
59 Chapter 2 Exercises A stack is often used as an aid in more complex algorithms For example, stacks can be used in expression evaluation Consider the problem of having the user enter an expression to be evaluated –must account for operator precedence: * 3 –may be an indefinite number of nested parentheses: ( ( ) * ) / 5 Ordinarily, this would be a very difficult problem, but an algorithm using stacks makes it easy
60 Chapter 2 Exercises (cont.) First, a stack is used to convert an infix expression to a postfix expression Then, a stack is used to evaluate the postfix expression The following slides show how…
61 Infix Expression: ( * 2 ) – ( 6 / ) Postfix Expression: Stack Infix to Postfix Conversion
62 Stack Infix Expression: ( * 2 ) – ( 6 / ) Postfix Expression: First, we push an ‘(‘ onto an empty stack. Infix to Postfix Conversion (cont.)
63 Stack ( Infix Expression: ( * 2 ) – ( 6 / ) Postfix Expression: First, we push an ‘(‘ onto an empty stack. Infix to Postfix Conversion (cont.)
64 ( Stack Infix Expression: ( * 2 ) – ( 6 / ) Postfix Expression: Then, we append a ‘)’ to the infix expression Infix to Postfix Conversion (cont.)
65 ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: Then, we append a ‘)’ to the infix expression Infix to Postfix Conversion (cont.)
66 ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: Then, we read “tokens” from the infix expression, performing actions based on what we read. Infix to Postfix Conversion (cont.)
67 Infix to Postfix Conversion (cont.) If the token is a ‘(‘, we push it on the stack If the token is a number, we append it to the postfix expression If the token is a ‘)’, we pop the stack and append each popped token to the postfix expression, until we pop a ‘(‘ If the token is an operator, then while the top of the stack is an operator with precedence greater than or equal to the token, we pop the stack and append the popped operator to the postfix expression; when we are done popping, we push the token onto the stack
68 ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: Infix to Postfix Conversion (cont.)
69 ( ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: Infix to Postfix Conversion (cont.)
70 ( ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: Infix to Postfix Conversion (cont.)
71 ( ( 5 Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: Infix to Postfix Conversion (cont.)
72 ( ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 Infix to Postfix Conversion (cont.)
73 ( ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 Not even an operator here, so we don’t pop anything. Infix to Postfix Conversion (cont.)
74 ( ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 Infix to Postfix Conversion (cont.)
75 ( ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 Infix to Postfix Conversion (cont.)
76 ( ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 Infix to Postfix Conversion (cont.)
77 ( ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 3 Infix to Postfix Conversion (cont.)
78 ( ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 3 Infix to Postfix Conversion (cont.)
79 ( ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 3 This is an operator, but its precedence is less than *, so we don’t pop. Infix to Postfix Conversion (cont.)
80 ( ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 3 Infix to Postfix Conversion (cont.)
81 ( ( + * Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 3 Infix to Postfix Conversion (cont.)
82 ( ( + * Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: 5 3 Infix to Postfix Conversion (cont.)
83 ( ( + * Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: Infix to Postfix Conversion (cont.)
84 ( ( + * Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: Infix to Postfix Conversion (cont.)
85 ( ( + * Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: Infix to Postfix Conversion (cont.)
86 ( ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * Infix to Postfix Conversion (cont.)
87 ( ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * Infix to Postfix Conversion (cont.)
88 ( ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + Infix to Postfix Conversion (cont.)
89 ( ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + Infix to Postfix Conversion (cont.)
90 ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + Infix to Postfix Conversion (cont.)
91 ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + Infix to Postfix Conversion (cont.)
92 ( - Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + Infix to Postfix Conversion (cont.)
93 ( - Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + Infix to Postfix Conversion (cont.)
94 ( - ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + Infix to Postfix Conversion (cont.)
95 ( - ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + Infix to Postfix Conversion (cont.)
96 ( - ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + 6 Infix to Postfix Conversion (cont.)
97 ( - ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + 6 Infix to Postfix Conversion (cont.)
98 ( - ( / Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + 6 Infix to Postfix Conversion (cont.)
99 ( - ( / Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * + 6 Infix to Postfix Conversion (cont.)
100 ( - ( / Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * Infix to Postfix Conversion (cont.)
101 ( - ( / Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * Infix to Postfix Conversion (cont.)
102 ( - ( / Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * Infix to Postfix Conversion (cont.)
103 ( - ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / Infix to Postfix Conversion (cont.)
104 ( - ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / Infix to Postfix Conversion (cont.)
105 ( - ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / Infix to Postfix Conversion (cont.)
106 ( - ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / 7 Infix to Postfix Conversion (cont.)
107 ( - ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / 7 Infix to Postfix Conversion (cont.)
108 ( - ( + Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / 7 Infix to Postfix Conversion (cont.)
109 ( - ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / 7 + Infix to Postfix Conversion (cont.)
110 ( - ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / 7 + Infix to Postfix Conversion (cont.)
111 ( - Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / 7 + Infix to Postfix Conversion (cont.)
112 ( - Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / 7 + Infix to Postfix Conversion (cont.)
113 ( - Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / 7 + Infix to Postfix Conversion (cont.)
114 ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / Infix to Postfix Conversion (cont.)
115 ( Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / Infix to Postfix Conversion (cont.)
116 Stack Infix Expression: ( * 2 ) – ( 6 / ) ) Postfix Expression: * / Infix to Postfix Conversion (cont.)
117 Postfix Expression: * / Stack Postfix Expression Evaluation
118 Postfix Expression: * / Stack When evaluating a postfix expression, a number encountered is simply pushed onto the stack. Postfix Expression Evaluation (cont.)
119 5Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
120 5Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / When an operator is encountered, it is used to perform an operation on the top 2 elements of the stack – in the following slides, take careful note of how it is done… Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
* Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
* Stack Postfix Expression: * / Was the topmost element – order can be important here! Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
/ Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
160 1 Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
161 1Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
162 1Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)
163 1 Answer: Stack Postfix Expression: * / Postfix Expression Evaluation (cont.)