LeetCode 83. The deletion sort the list of repeating elements
Given a sorted list, delete all the duplicate elements, leaving only the original list does not duplicate elements.
LeetCode maximum area 695. The island 's largest island problem (I thought of a divide and conquer, wrong ideas, direct explosion, the interviewer is good, to me for the questions)
Programming Question 2: 1 stock profits (also required to write test cases, requirements to run through)
Programming Problem 3: 2 stock returns (buy and sell multiple) (these two questions are seconds, the night before the interview just want to brush them dp title, brush these two questions, so that we think of what must go to school !!!)
Programming questions 1: 1 stock profits
Programming Question 2: 3 stock returns (buy and sell twice) (check the next, is the stock profits 3, hard)
Binary search, output index
19. The length of the array 10, the random numbers 0 to 9 and may be repeated to identify duplicate numbers, requires: time complexity of O (n), the spatial complexity is O (1); ( if someone would please stick to the comments section, thank you, note the time and space complexity)
public class Main{ public static void main(String[] args) { int[] arr = {1,1,1,1,2,4,4,6,6,6}; for (int i = 0; i < arr.length; i++) { int index = arr[i]; if (index == i || index == -1){ continue; }else if (index != arr[index] && arr[index] != -1){ int tmp = arr[i]; arr[i] = arr[index]; ARR [index] =tmp; I - ; } the else IF (index == ARR [index]) { of System.out.print (index + "" ); ARR [index] = -1; // prevented as {3, such output 3,3} 33 } } } }
Comparison of sorting algorithms, complexity, stability
LeetCode 138. Copy pointer list with Random
Algorithm Title: k is the size divided by the list soon, the block list will be reversed
Algorithm title
-
Gives a = 1, b = 2, ..., z = 26 such a coding, to ask how many such cases the composition 126 (speaking ideas)
-
Can only hold a stock of maximum benefit is how much stock trading
. Talk about sorting algorithms know what? How much time complexity is? The best case is how much? The worst case is how much?
Arithmetic problem, given a precision square root of a number
Algorithms question: Flip string of words: such as "how are you" becomes "you are how"
There are a total of two five three kinds of coins to make up 100 yuan ask how much is the minimum number of coins? (Dynamic programming)
9. Write a title integer division, can not be used except No.
Puzzles