Question: Q) DRAW SYMBOL TABLE for the following code using separate chaining approach. Assume size of the table is 10. Show how the table evolves at
Q) DRAW SYMBOL TABLE for the following code using separate chaining approach. Assume size of the table is 10. Show how the table evolves at each statement. You can calculate hash value using the hash() function provided underneath:
- public class CC {
- int a;
- public void m(int a) {
- char c='B';
- {
- double d=0.0;
- }
- }
- } //end CC class
public int hash( String k ) {
int value = 0;
for( int i=0; i
value = value + (int)k.charAt( i );
}
return value % 10;
} //end HASH() function
Hint: A-Z ranges 65-90 and a-z ranges 97-122. Hence identifier A will have has value 5, B will have 6, and similarly identifier AB will have 1 and so on.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
