Posts

Showing posts from November, 2017

Soalan Ulangkaji Queue

Soalan ulangkaji queue link1 Soalan ulangkaji queue link2

Java precedence

Level Operator Description Associativity 16 [] . () access array element access object member parentheses left to right 15 ++ -- unary post-increment unary post-decrement not associative 14 ++ -- + - ! ~ unary pre-increment unary pre-decrement unary plus unary minus unary logical NOT unary bitwise NOT right to left 13 () new cast object creation right to left 12 * / % multiplicative left to right 11 + - + additive string concatenation left to right 10 << >> >>> shift left to right 9 < <= > >= instanceof relational not associative 8 == != equality left to right 7 & bitwise AND left to right 6 ^ bitwise XOR left to right 5 | bitwise OR left to right 4 && logical AND left to right 3 || logical OR left to right 2 ?: ternary right to left 1  =   +=   -= *=   /=   %= &=   ^=   |= <<=  >>= >>>= assignment right to left Resource: https://introcs.cs.princeton.edu/java/11precedence/

video infix prefix postfix

Image

Soalan Ulangkaji(Stack)

Ulangkaji Stack link 1 Ulangkaji Stack link 2

DataSructure Lab 6

Laboratory Sheet 6 1.        Write a method to generate 1000 numbers between 1-1000. Use random number generator. Store the numbers in an array of integer. 2.        Write a method to sort numbers generated in 1. Implement selection sort . 3.        Write a method to sort numbers generated in 1. Implement bubble sort . 4.        Write a method to sort numbers generated in 1. Implement linear insertion sort . 5.        Compare the time taken to sort 1000 numbers between the three methods. 6.        Repeat 1-5, with 15000 numbers.

clock