Tag: data structure
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. This is an data-structure problem that you would need to come up with …
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Merging …
Given an array of n integers where n > 1, nums, return an array output such that output is equal to the product of all the elements of nums …
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 …
Given a string that consists of words (non-space characters count as part of a word), you are required to output the new sentence that reverses the words. For example, …