摘要: FInd the max area. 1. 三分法 2. NAN (not comparable with number) http://acm.timus.ru/problem.aspx?space=1&num=1874 阅读全文
posted @ 2018-10-13 14:00 wz30 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 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) 阅读全文
posted @ 2018-10-08 01:27 wz30 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-09-22 04:18 wz30 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-26 09:12 wz30 阅读(340) 评论(0) 推荐(0) 编辑
摘要: Solution: recusrion (think about better recursion(memo)) Solution Memo + crack the interview 阅读全文
posted @ 2018-08-22 10:58 wz30 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-19 11:14 wz30 阅读(435) 评论(0) 推荐(0) 编辑
摘要: Solution: make a queu and coun the number of 0 or use two pointers clerverly(think aboun the logic) 阅读全文
posted @ 2018-08-17 12:55 wz30 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-17 12:40 wz30 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-14 08:58 wz30 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-08-13 05:43 wz30 阅读(202) 评论(0) 推荐(0) 编辑