原创 Writing a Key Value Store
Writing a Key Value StoreThe purpose of this exercise is to write a basic key value store. It should use string keys an
原创 N-Queens
N-Queens The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens att
原创 summary ranges
Summary Ranges Given a sorted integer array without duplicates, return the summary of its ranges. For example, give
原创 Scramble String
Scramble String Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty subst
原创 Find the First Nonrepeated Character
Find the First Nonrepeated Character Write an efficient function to find the first nonrepeated character in a string. F
原创 Remove Specified Characters
Remove Specified Characters Write an efficient function in JAVA that deletes characters from a string. Use the prototy
原创 Lowest Common Ancestor of a Binary Search Tree
Lowest Common Ancestor of a Binary Search Tree Given a binary search tree (BST), find the lowest common
原创 Integer/String Conversions
Integer/String Conversions Write two conversion routines. The first routine converts a string to a signed integer. You
原创 Implement Stack Using LinkedList
import java.io.*; import java.util.*; /* * To execute Java, please define "static void main" on a class * named Solu
原创 Recover Binary Search Tree
Recover Binary Search Tree Two elements of a binary search tree (BST) are swapped by mistake. Recover the t
原创 Merge Intervals
Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], retu
原创 Copy List With Random Pointer
Copy List with Random Pointer A linked list is given such that each node contains an additional random pointer whi
原创 Reverse Words in a String
Reverse Words in a String Given an input string, reverse the string word by word. For example, Given s = "the sky is
原创 Read N Characters Given Read4
The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of char
原创 Best Time to Buy and Sell Stock III
Best Time to Buy and Sell Stock III Say you have an array for which the ith element is the price of a given stoc