Category: c / c++
Question : Given a sorted list represented by a directional link structure (as follows), remove the duplicates and return the new list. /** * Definition for singly-linked list. * …
Given two binary trees (defined structure in C++ as follows), check if they are identical (same tree structure and the values to the nodes are also the same): /** …
Question: You are climbing stairs. It takes n steps to get to the top. Each time, you can take 1 step or 2 steps. How many distinct ways to get to …
Question: Given an unsorted list of integers, find out the first missing positive. Problem Description: http://oj.leetcode.com/problems/first-missing-positive/ Examples: should return 3; should return 2. Can you do it with O(n) …
Question: Determine the length of the last word in a string given in C, as const char* Problem Description: http://oj.leetcode.com/problems/length-of-last-word/ A word is defined as a sequence of non-space characters. …