摘要:
FInd the max area. 1. 三分法 2. NAN (not comparable with number) http://acm.timus.ru/problem.aspx?space=1&num=1874 阅读全文
摘要:
Given an unsorted integer array, find the smallest missing positive integer. Example 1: Example 2: Example 3: Note: Your algorithm should run in O(n) 阅读全文
摘要:
http://acm.timus.ru/problem.aspx?space=1&num=1100 link to the problem make a fast stable sorting algorithm. what is sort in c, quick sort. what is a s 阅读全文
摘要:
1. is palindrome solution 1: check to reverse the digit, if they are the same number https://www.geeksforgeeks.org/write-a-c-program-to-reverse-digits 阅读全文
摘要:
Solution: recusrion (think about better recursion(memo)) Solution Memo + crack the interview 阅读全文
摘要:
Solution: why we use binary search here, thr brute force search method is get max(min (dist)), to reduce time complexixity we need to use binary searc 阅读全文
摘要:
Solution: make a queu and coun the number of 0 or use two pointers clerverly(think aboun the logic) 阅读全文
摘要:
Basically just clone the graph like clone a list in leetcode 138. there are three ways t solve this (just traverse the graph and put new node into map 阅读全文
摘要:
Solution: dfs or bfs or union find FOllow up get max number of islands 695 SOlution dfs + array to store the number There is another aolution with dfs 阅读全文
摘要:
Solution: build tree, how to divide the array for each root and subtree we can use map to get the index of the array for a specific element Solution 2 阅读全文