876. Middle of the Linked List
Given the head
of a singly linked list, return the middle node of the linked list.
876. Middle of the Linked List
Given the head
of a singly linked list, return the middle node of the linked list.
Given an integer array nums
, move all 0
's to the end of it while maintaining the relative order of the non-zero elements.
Given a non-empty array of integers nums
, every element appears twice except for one. Find that single one.
Given the head
of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list.
225. Implement Stack using Queues
Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push
, top
, pop
, and empty
).
Given the head
of a linked list, return the list after sorting it in ascending order.