You are viewing a single comment's thread. Return to all comments →
You need to type cast "queue.poll()" because it will give you an object so you need to type cast it to Node object "(Node)queue.poll()".
Tree: Level Order Traversal
You are viewing a single comment's thread. Return to all comments →
You need to type cast "queue.poll()" because it will give you an object so you need to type cast it to Node object "(Node)queue.poll()".