| Title | Open | |||
|---|---|---|---|---|
| 411 | Push a Value onto an Array StackAn array-backed stack stores its values in an int array and keeps top as the index of the item currently on top. | easy | Not started | Solve |
| 412 | Pop and Peek on an Array StackThe array stack can already push and display itself. | easy | Not started | Solve |
| 413 | Is the Array Stack Empty or Full?push, pop and peek all lean on two tiny status methods, and both of them are missing. | easy | Not started | Solve |
| 414 | Display an Array Stack Bottom to TopThe stack works, but printing one shows nothing useful. | easy | Not started | Solve |
| 415 | Push onto a Linked-Node StackThis stack has no array and no capacity - it is a chain of nodes, and the field top points at the front of that chain. | easy | Not started | Solve |
| 416 | Push and Pop a Generic StackMyStack<T> holds any type by storing the values in an Object array. | easy | Not started | Solve |
| 417 | Enqueue Into an Array QueueShiftQueue stores its values in a plain array and always keeps the front at index 0. | easy | Not started | Solve |
| 418 | Dequeue by Shifting LeftShiftQueue keeps the front of the queue at index 0, so removing it means sliding every later value down one slot. | easy | Not started | Solve |
| 419 | Enqueue With WraparoundCircularQueue never shifts. | easy | Not started | Solve |
| 420 | Dequeue From a Circular QueueCircularQueue removes a value by moving front forward instead of shifting the whole array. | easy | Not started | Solve |
| 421 | Enqueue at the Tail of a Linked QueueLinkedQueue adds at the tail and removes at the head, so it tracks both ends. | easy | Not started | Solve |
| 422 | Peek at the Front of a Linked QueueLinkedQueue is complete except for peek(), the method that looks at the front of the queue without removing anything. | easy | Not started | Solve |
| 423 | Transfer One Stack Into the OtherStackQueue fakes a queue out of two stacks: enqueue pushes onto inbox, while dequeue and peek take from outbox, which holds values already flipped into arrival order. | easy | Not started | Solve |
| 424 | Serve the Print QueuePrintQueue holds waiting job names in a java.util.Queue so the printer serves them in submission order. | easy | Not started | Solve |
| 425 | Add a Node to the FrontAn IntList keeps its nodes in a chain that starts at head. | easy | Not started | Solve |
| 426 | Add a Node to the EndaddFirst() is already written for you. | easy | Not started | Solve |
| 427 | Remove the First NodeUnlinking the head node is the mirror image of addFirst(): read the value out, then let head skip over the node being dropped. | easy | Not started | Solve |
| 428 | Count the NodesThis IntList stores no counter, so size() has to find out the hard way: start a cursor at head and follow next until it runs off the end, counting as it goes. | easy | Not started | Solve |
| 429 | Find the Index of the Smallest ValueNumberList owns an int array and its size. | easy | Not started | Solve |
| 430 | Finish the Bubble Sort Inner LoopNumberList owns an int array and its size. | easy | Not started | Solve |
| 431 | Drop the Key Into Place (Insertion Sort)Insertion sort never swaps. | easy | Not started | Solve |
| 432 | Finish the Binary Search Middle StepThis NumberList is built from values already in ascending order. | easy | Not started | Solve |
| 433 | Add to the Front of a DequeArrayDequeInt holds up to 5 ints in a circular array. | easy | Not started | Solve |
| 457 | Find the Smallest Value in a BSTComplete findMin() so it returns the smallest value stored in the tree. | easy | Not started | Solve |
| 458 | Find the Largest Value With RecursionComplete the private helper findMax(Node node) so that findMax() returns the largest value in the tree. | easy | Not started | Solve |
| 459 | Search a BST for a ValueComplete contains(int value) so it returns true when value is stored in the tree and false when it is not. | easy | Not started | Solve |
| 460 | Insert a Value Into a BSTComplete the private helper insert(Node node, int value) so that insert(int value) adds a value to the tree in the right place. | easy | Not started | Solve |
| 461 | Print a BST In OrderComplete the private helper inOrder(Node node, StringBuilder sb) so that inOrder() returns every value in the tree, in in-order, separated by spaces. | easy | Not started | Solve |
| 462 | Print a BST in Pre-OrderComplete the private helper preOrder(Node node, StringBuilder sb) so that preOrder() returns every value in the tree, in pre-order, separated by spaces. | easy | Not started | Solve |
| 463 | Print a BST in Post-OrderComplete the private helper postOrder(Node node, StringBuilder sb) so that postOrder() returns every value in the tree, in post-order, separated by spaces. | easy | Not started | Solve |
| 464 | Count the Nodes in a BSTComplete the private helper size(Node node) so that size() returns how many values are stored in the tree. | easy | Not started | Solve |
| 465 | Measure the Height of a BSTComplete the private helper height(Node node) so that height() returns the height of the tree. | easy | Not started | Solve |
| 466 | Count the Leaves of a BSTComplete the private helper countLeaves(Node node) so that countLeaves() returns how many leaves the tree has. | easy | Not started | Solve |
| 467 | Find How Deep a Value SitsComplete depthOf(int value) so it returns how deep value sits in the tree, or -1 when value is not in the tree. | easy | Not started | Solve |
| 468 | Find a Heap Node's Parent and ChildrenComplete the three index helpers parent(int i), leftChild(int i) and rightChild(int i) in this min heap. | easy | Not started | Solve |
| 469 | Insert Into a Min Heap (Sift Up)Complete insert(int value) so it adds a value to the min heap and keeps the heap rule true. | easy | Not started | Solve |
| 470 | Insert Into a Max HeapComplete insert(int value) so it adds a value to the max heap and keeps the heap rule true. | easy | Not started | Solve |
| 471 | Check Whether an Array Is a Min HeapComplete isMinHeap(int[] values) so it returns true when the array, read as a heap, follows the min-heap rule, and false when any parent is bigger than one of its children. | easy | Not started | Solve |
| 472 | Sort Numbers With a PriorityQueueComplete sortedOrder(int[] values) so it returns every value from smallest to largest as one string with a single space between values, letting Java's PriorityQueue do the sorting. | easy | Not started | Solve |
| 473 | Turn a PriorityQueue Into a Max HeapComplete largest(int[] scores, int k) so it returns the k largest scores from biggest to smallest, as one string with a single space between them. | easy | Not started | Solve |
| 474 | Update an AVL Node's HeightComplete updateHeight(Node node) so every node's stored height stays correct while values are inserted. | easy | Not started | Solve |
| 475 | Compute an AVL Node's Balance FactorComplete balanceFactor(Node node) so the tree can report how lopsided each node is. | easy | Not started | Solve |
| 476 | Check That Every Node Is BalancedComplete isBalanced(Node node) so isAVL() reports whether every node in the tree obeys the AVL balance rule. | easy | Not started | Solve |
| 552 | Read a Slot Safely From a Dynamic ArrayA DynamicArray keeps its values in an ordinary int array called data, but only the first size slots are in use. | easy | Not started | Solve |
| 553 | Append to a Dynamic ArrayA DynamicArray makes itself bigger when it runs out of room, so adding to it can never fail. | easy | Not started | Solve |
| 554 | Double a Full Array With growA Java array can never change its length, so a dynamic array grows by moving house: it makes a longer array, copies its values across, and uses the new array from then on. | easy | Not started | Solve |
| 555 | Search Only the Used SlotsSearching a dynamic array is a plain scan from the front, with one trap: the array data is usually longer than the list. | easy | Not started | Solve |
| 556 | Shift Right to Insert at an IndexTo put a value in the middle of an array, everything from that position onward has to move one slot to the right first. | easy | Not started | Solve |
| 557 | Shift Left to Remove at an IndexRemoving from the middle of an array leaves a gap, and a dynamic array closes it by moving every later value one slot to the left. | easy | Not started | Solve |
| 558 | Remove the First Match Using Two HelpersA class that already has good helpers should use them. | easy | Not started | Solve |
| 559 | Add to the Front of a Doubly Linked ListIn a doubly linked list every DNode has a prev link as well as a next link. | easy | Not started | Solve |
| 560 | Add to the Back of a Doubly Linked ListBecause the list keeps a tail reference, adding at the back needs no walk at all: it is O(1), the same cost as adding at the front. | easy | Not started | Solve |
| 561 | Remove the First Node of a Doubly Linked ListRemoving the first node of a doubly linked list has one step more than in a singly linked list: the node that becomes the new head still holds a prev link to the node being dropped, and that link has to be cleared. | easy | Not started | Solve |
| 562 | Insert After a Node in a Doubly Linked ListInserting in the middle of a doubly linked list never shifts anything. | easy | Not started | Solve |
| 563 | Unlink a Middle Node From a Doubly Linked ListA node in the middle of a doubly linked list can unlink itself, because it can see both of its neighbours. | easy | Not started | Solve |
| 564 | Read the Kth Value From the End of a Doubly Linked ListA singly linked list can only be read from the front, so reaching a value counted from the end means working out its position first. | easy | Not started | Solve |
| 434 | Build the Array Stack CoreThe two fields are declared but nothing sets them up, so a new stack is unusable. | medium | Not started | Solve |
| 435 | Finish the Linked-Node Stackpush and the display are written. | medium | Not started | Solve |
| 436 | Check for Balanced BracketsA stack is the classic way to check bracket nesting: an opener waits on the stack until its own closer shows up. | medium | Not started | Solve |
| 437 | Track the Minimum With a Second StackMinStack keeps two stacks: main holds every value, and mins holds only the values that were the smallest so far, so getMin() can just read the top of mins. | medium | Not started | Solve |
| 438 | Evaluate a Postfix ExpressionIn postfix notation the operator comes after its two operands, so 3 4 + means 3 + 4. | medium | Not started | Solve |
| 439 | Guard an Empty Array QueueShiftQueue can already accept values and print itself, but nothing stops it reading a slot it does not own. | medium | Not started | Solve |
| 440 | Build the Circular Queue CoreThis CircularQueue has its three fields declared but never set up, and both methods that move values are missing. | medium | Not started | Solve |
| 441 | Circular Queue With front and rearRingQueue tracks front and rear instead of a size counter, which creates a problem: front == rear would mean both empty and completely full. | medium | Not started | Solve |
| 442 | Build Both Ends of a Linked QueueLinkedQueue adds at the tail and removes at the head, so the two missing methods must keep head, tail and size telling the same story. | medium | Not started | Solve |
| 443 | Queue From Two StacksStackQueue must behave like a queue while owning nothing but two stacks. | medium | Not started | Solve |
| 444 | Find a Node by Index and by ValueA linked list has no random access, so both lookups are the same walk with a different stopping rule: one counts steps, the other compares values. | medium | Not started | Solve |
| 445 | Insert and Remove at a PositionBoth methods share one invariant: to change a link you must be standing on the node BEFORE the target, because a singly linked node cannot see backwards. | medium | Not started | Solve |
| 446 | Remove the First Node Holding a ValueUnlike a counted walk, this one stops on data you cannot predict, so carry two cursors: previous stays one node behind current, because the link you must rewire lives in previous. | medium | Not started | Solve |
| 447 | Keep the Tail Pointer HonestA TailedIntList holds head, tail and a size counter so that appending costs O(1) instead of the walk IntList needs. | medium | Not started | Solve |
| 448 | Remove the Last NodeThe tail pointer hands you the last node instantly, but it does not save you here: to unlink it you need the node BEFORE it, and a singly linked node cannot look back. | medium | Not started | Solve |
| 449 | Walk a Doubly Linked List Both WaysEvery DNode carries a prev as well as a next, so the same chain can be read from either end. | medium | Not started | Solve |
| 450 | Remove the Last Node of a Doubly Linked ListIn a singly linked list, removing the last node requires walking the chain to find the node before tail. | medium | Not started | Solve |
| 451 | Reverse the List In PlaceReversing means re-aiming every next pointer at the node behind it instead of building a second list. | medium | Not started | Solve |
| 452 | Find the Middle NodeYou could call size() and walk half of it, but one pass is enough: move slow one node at a time and fast two, and when fast runs off the end slow is standing on the middle. | medium | Not started | Solve |
| 453 | Build Selection Sort From Its HelperNumberList gives you two finished helpers: findMinIndex(int start), which returns the INDEX of the smallest value from start onward, and a private swap(int i, int j). | medium | Not started | Solve |
| 454 | Write Binary Search From ScratchThis NumberList is built from values that are already in ascending order, so it can be searched by halving the range instead of scanning it. | medium | Not started | Solve |
| 455 | Keep a List Sorted as You InsertSortedIntList stays in ascending order at all times, so there is no sort to run afterwards. | medium | Not started | Solve |
| 456 | Build Both Ends of a DequeA deque has four doors: add and remove at each end. | medium | Not started | Solve |
| 477 | Find the Kth Smallest Value in a BSTComplete kthSmallest(int k) and its helper walkInOrder(Node node, int k) so the tree can answer the question: what is the k-th smallest value? | medium | Not started | Solve |
| 478 | List the Values Between Low and HighComplete collect(Node node, int low, int high, StringBuilder sb) so valuesBetween(low, high) returns every value from low to high, both ends included, smallest first and separated by single spaces. | medium | Not started | Solve |
| 479 | Check Whether a Tree Is a Valid BSTComplete the private helper isValid(Node node, Integer min, Integer max) so BSTValidator.isValid(root) returns true only when the whole tree follows the BST rule. | medium | Not started | Solve |
| 480 | Find the Lowest Common Ancestor in a BSTComplete lowestCommonAncestor(int a, int b) so it returns the value of the lowest common ancestor of a and b, or -1 when either value is not in the tree. | medium | Not started | Solve |
| 481 | Print a BST Level by Level With a QueueComplete printLevels() so it prints the tree one level per line, from the root down. | medium | Not started | Solve |
| 482 | Remove the Minimum From a Min HeapComplete removeMin() so it takes the smallest value out of the heap, returns it, and leaves the rest of the array a valid min heap. | medium | Not started | Solve |
| 483 | Build a Max Heap From an Unsorted ArrayComplete the MaxHeap(int[] values) constructor and the private siftDown(int i) method, so a heap can be built from an unsorted array in one go instead of inserting the values one at a time. | medium | Not started | Solve |
| 484 | Keep the K Largest Values With a Min HeapComplete add(int score) and kthBest() so the Leaderboard keeps only the k highest scores it has ever seen, however many scores arrive. | medium | Not started | Solve |
| 485 | Rotate an AVL Subtree RightComplete rotateRight(Node y), the move an AVL tree uses to fix a subtree whose left side has grown two levels taller than its right. | medium | Not started | Solve |
| 486 | Rotate an AVL Subtree LeftComplete rotateLeft(Node x) so this AVL tree can fix itself when values keep arriving on the right. | medium | Not started | Solve |
| 487 | Delete a Value From a BSTComplete remove(Node node, int value) and its helper minValue(Node node) so tree.remove(value) takes value out of the tree and leaves a tree that still follows the BST rule. | hard | Not started | Solve |
| 488 | Walk a BST In Order With a StackComplete BSTIterator so it hands out a tree's values one at a time, smallest first: next() returns the next value in sorted order, and hasNext() says whether any values are left. | hard | Not started | Solve |
| 489 | Heap Sort an Array In PlaceComplete HeapSort so heapSort(int[] a) sorts the array from smallest to largest IN PLACE, using the array itself as a max heap. | hard | Not started | Solve |
| 490 | Track the Running Median With Two HeapsComplete add(int value) and median() so MedianTracker can report the median of every number added so far, at any moment, without sorting the numbers again each time. | hard | Not started | Solve |
| 491 | Insert Into an AVL Tree and RebalanceFinish a self-balancing AVL tree: complete rotateRight, rotateLeft and the rebalancing step at the end of insert, so the tree is balanced again after every insert. | hard | Not started | Solve |