Category: data structure
A Singly Linked List is a one-direction List that uses a pointer to connect between Nodes. To reverse a linked list, you need to re-connect the directions, for example: …
Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = “anagram”, t = “nagaram”, return true. s …
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 …
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it …
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 …