Posts with tag 'queue'

Maximum Sum Rectangle with Condition

less than 1 minute read

Given a two-dimensional integer matrix matrix and an integer k, return the largest sum of a rectangle ≤ k.

Bipartite Graph

1 minute read

Given an undirected graph represented as an adjacency list, return whether the graph is bipartite.

Top View of a Tree

less than 1 minute read

Given a binary tree root, return the top view of the tree, sorted left-to-right.

Level Order Traversal

less than 1 minute read

Given a binary tree root return a level order traversal of the node values.

Level Order Alternating

less than 1 minute read

Given a binary tree root, return values of the nodes in each level, alternating from going left-to-right and right-to-left.

Leaves in Same Level

less than 1 minute read

Given a binary tree root, return whether all leaves are at the same level.

Back to top ↑