SoftwareGuy256 is right - the OP's first AST is in fact correct. I just ran that expression through my Java subset compiler and looked at the AST printout, and it matches what he has.
The divide being above the multiply does NOT mean that division has a higher or lower precedence than multiplication; it just means that the 3*4 is being done before the divide by 5. This implies that binary operations are left associative, which is the case in C-like languages. If you don't believe me, try running the following program and tell me what you get: (you should get a result of 2, with "three", "four", then "five" being printed out.)
int three() { printf("three\n"); return 3;}int four() { printf("four\n"); return 4;}int five() { printf("five\n"); return 5;}int main() { int x = three()*four()/five(); printf("%d\n", x); return 0;
In general, if you have a sequence of binary operations with the same precedence level and you want to capture left associativity, you place the rightmost operator as the root, which is what the OP has done.