楼主: Oceanid77
跳转到指定楼层
上一主题 下一主题
收起左侧

刷题记录帖

🔗
 楼主| Oceanid77 2019-11-6 14:29:26 | 只看该作者
全局:
今天看了udemy上关于graph的相关的视频。
明天google hr面试,应该是讨论相关的一些工作。 我今天就看了一下BQ。 然后想了一下应该是要讨论什么呢?
有些事情别人要怎么做跟我无关,管好自己的事情就足够了。别心软。
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-11-7 10:54:47 | 只看该作者
全局:
https://www.geeksforgeeks.org/bitwise-operators-in-java/
how to convert a number to binary


  public boolean dfs(int node, int c) {
        if (color.containsKey(node))
            return color.get(node) == c;
        color.put(node, c);

        for (int nei: graph[node])
            if (!dfs(nei, c ^ 1))
                return false;
        return true;
    }
https://www.cnblogs.com/grandyang/p/10317141.html
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-11-8 14:30:49 | 只看该作者
全局:
https://www.geeksforgeeks.org/merge-sort/
what is merge sort? what is the process for merge sort?

Using Object class methods
https://www.geeksforgeeks.org/object-class-in-java/

Divide and Conquer Algorithm
53. Maximum Subarray
I cannot get how to go from idea to implementation.

What is recursion? How does it work?
How to solve a problem recursively?
How to analyze the time and space complexity of a recursive algorithm?
How can we apply recursion in a better way?
344. Reverse String
24. Swap Nodes in Pairs
very good example of recursion!!!
25. Reverse Nodes in k-Group
Good !! not yet study
541. Reverse String II
what I think is a little complecated.
prctice tmr
class Solution {
    public String reverseStr(String s, int k) {
        int n =0;
        while((2*n*k+k)<=s.length()){
            reversepartialStr(s, 2*n*k, 2*n*k+k-1);
                k++;
        }
        if((2*n*k)<s.length()-1){reversepartialStr(s,2*n*k,s.length()-1);}
        return s;
    }
    public void reversepartialStr(String s, int left, int right){
        for(int i=left; i<=(right+left)/2;i++){
            Character temp= s.charAt(i);
            s.charAt(i)=s.charAt(right-left+i);
            s.charAt(right-left+i)=temp;
        }
    }
}

118. Pascal's Triangle
Good, study tomorrow.
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-11-10 09:09:13 | 只看该作者
全局:
Friday
Pascal's Triangle
https://www.geeksforgeeks.org/list-interface-java-examples/

How to implement
206. Reverse Linked List
think about process iteratively and recursively.!!!

what is process? what is needed.

70. Climbing Stairs
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-11-10 14:47:11 | 只看该作者
全局:
104. Maximum Depth of Binary Tree
Iterative way? I dont understand the process.

Matrix
1253. Reconstruct a 2-Row Binary Matrix
Pascal's Triangle
learn the way to manipulate 2 d matrix

1252. Cells with Odd Values in a Matrix
count number of occurance

Sliding Window
992. Subarrays with K Different Integers
1248. Count Number of Nice Subarrays

study tmr
hashmap, stack/queue, list,
add push put
get pop poll
have a summary

1249. Minimum Remove to Make Valid Parentheses
study tomorrow
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-11-11 11:38:30 | 只看该作者
全局:
96. Unique Binary Search Trees


21. Merge Two Sorted Lists
use recursive method

779. K-th Symbol in Grammar
not undderstand
96. Unique Binary Search Trees
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-11-12 14:02:09 | 只看该作者
全局:
Time Complexity of merge sort is nlogn.

why?

Arrays.sort() in Java with examples
https://www.geeksforgeeks.org/arrays-sort-in-java-with-examples/

98. Validate Binary Search Tree
I cannot get the recursive way. need more time

912. Sort an Array

https://leetcode.com/problems/va ... ple-tree-questions-(Java-Solution)

94. Binary Tree Inorder Traversal
Approach 2: Iterating method using Stack
not done
Approach 3: Morris Traversal
145. Binary Tree Postorder Traversal
145. Binary Tree Preorder Traversal
how to use iterating method?
TreeNode node = stack.pollLast();
      output.addFirst(node.val);
https://leetcode.com/problems/bi ... r-without-reversing
74. Search a 2D Matrix
done
240. Search a 2D Matrix II
study tmr
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-11-13 14:14:43 | 只看该作者
全局:
本帖最后由 Oceanid77 于 2019-11-13 14:17 编辑

QuickSort
https://www.geeksforgeeks.org/quick-sort/
when you know the pivot, how to arrange the number. this is a trick to learn,
  Master Theorem  mei kan dong 55555

  Backtracking

51. N-Queens
Good question, study tmr!
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-11-14 14:29:12 | 只看该作者
全局:
51. N-Queens
489. Robot Room Cleaner
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-11-15 14:34:28 | 只看该作者
全局:
51. N-Queens
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表