📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
查看: 1801| 回复: 16
跳转到指定楼层
上一主题 下一主题
收起左侧

[坚持]刷题打卡,激励自己

全局:

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
正在准备春招,一边做项目,一边刷题,之前因为拖延症错过了很多时间,于此开帖激励自己每天坚持刷题.
罗马不是一天建成的,要从今天开始!

评分

参与人数 2大米 +6 收起 理由
timeless_tan + 3 赞赞赞!
All_in + 3 给你点个赞!

查看全部评分


上一篇:求助!!!关于找算法类的实习的一些问题
下一篇:刷题记录专用贴
推荐
 楼主| zhishang9_apply 2018-12-16 18:07:16 | 只看该作者
全局:
打卡12.15  滴 =```
1. Check tweaked identical tree.
    Recursion. Check from top to down.
    Time: O(n), space: O(height)
2. Check tree is binary search tree (BST)
    Recursion. For every node, set large and small threshold. Send value from down to top.
    Time: O(n), space: O(1)
3. Get keys in BST in range
    Inorder traversal. Trivial.
    Time: O(n), space: O(height)
4. K smallest elements in unsorted array
    Use max heap with size k as a sliding window.
    Time: O(nlogk), space: O(k)

评分

参与人数 2大米 +6 收起 理由
J-fighting + 3 老哥加油!
Sisyphustina + 3 看你刷了好多BST的题目呀,加油呀~~~

查看全部评分

回复

使用道具 举报

推荐
 楼主| zhishang9_apply 2018-12-13 16:24:34 | 只看该作者
全局:
打卡12.13  滴 =```
1. Sort with two stacks.
    For the second stack, the left part is for the sorted elements, the right part is for buffering.
    Time: O(n^2), space: O(1).
2. Implement queue by 2 stacks.
    One stack is for pushing element inside, the other stack is for pulling out elements.
    Time:  poll(): amortized O(1), worst O(n); offer(): O(1); size(): O(1); Space: O(1), not including two stacks
3. Enhance the stack implementation to support min() operation.
    The idea is maintaining a minStack, so that we use extra O(n) space to achieve O(1) time on min().
    Time: min(): O(1), pop(): O(1), push: O(1), top(): O(1)
4. Implement Mergesort on LinkedList.
    The basic idea is the same as mergesort. Need implementing findMidNode(), reverseLinkedList(), merge()
    Time: O(nlogn), Space: O(1)

评分

参与人数 2大米 +4 收起 理由
zhangli811811 + 1 赞一个
J-fighting + 3 非常有用的信息

查看全部评分

回复

使用道具 举报

推荐
 楼主| zhishang9_apply 2018-12-14 16:40:40 | 只看该作者
全局:
打卡12.14  滴 =```
1. Binary tree pre-order traversal:
    (1) iterative version. Time: O(n), space: O(n), using an extra stack.
    (2) recursive version. Time: O(n), space: O(Height of tree)
2. Find tree height.
    Use recursion. Trivial.
    Time: O(n). Space: O(1)
3. Binary tree in-order traversal:
    Use a stack, keep adding the left node until null, then turn right, keep doing this in the while loop.
    iterative version, time: O(n), space: O(n)
4. Check if binary tree is balanced.
    Recursion. For each node, return -1 if not balanced.
    Time: O(n), space: O(1)
5. Check if binary tree is symmetric.
    Recursion. From down to top.
    Time: O(n), space: O(1)
回复

使用道具 举报

🔗
All_in 2018-12-18 08:05:45 | 只看该作者
本楼:
全局:
加油!

评分

参与人数 1大米 +3 收起 理由
zhishang9_apply + 3 Thx!

查看全部评分

回复

使用道具 举报

🔗
 楼主| zhishang9_apply 2018-12-18 18:00:48 | 只看该作者
全局:
打卡12.17  滴 =```
1. Print tree layer by layer
    Use queue to store each level.
    Time: O(n). Space: O(n)
2. Check graph is Bipartite or not.
    BFS. Use queue to store level and HashMap to store group 0/1 status.
3. Check tree is a complete tree.
    Trivial.
    Time: O(n). SpaceL O(1).
4. Kth smallest in matrix
    Use priority queue (min heap). Expand in right and down direction.
    Time: O(n + klogk). Space: O(n)
回复

使用道具 举报

🔗
 楼主| zhishang9_apply 2018-12-19 08:22:08 | 只看该作者
全局:
后天考最后一门,还有好多没复习所以先停两天,等后天考完当天晚上再刷

评分

参与人数 1大米 +3 收起 理由
J-fighting + 3 支持老哥

查看全部评分

回复

使用道具 举报

🔗
 楼主| zhishang9_apply 2018-12-28 13:21:33 | 只看该作者
全局:
刚刚拿了GS的OA,刷地里小伙伴们提供的题,就勉强当作打卡了,12.27 滴 =```
1. CodeFriends
2. CommentRemover
3. CSVFormatter
4. ReverseAlgebraExpression
5. WholeMinimalDilemma
回复

使用道具 举报

🔗
 楼主| zhishang9_apply 2019-1-2 09:55:19 | 只看该作者
全局:
打卡 1.1 滴 =```,准备G家OA
1. LC253
2. Kth Largest in Array
3. merge k list
4. Find cycle node in linked list
5. move zeros in arrays
6. spiral order traverse in N*N matrix
7. plus one, array
8. spiral order traverse in M*N rectangle
9. find palindrome in String
10. valid parenthesis in String
回复

使用道具 举报

🔗
 楼主| zhishang9_apply 2019-1-3 00:05:42 | 只看该作者
全局:
打卡 1.2  滴 =```
1. max water trapped between bars
2. intersection of two arrays
3. remove duplicate in list
4. word pattern 1
5. path in binary tree, recursion
6. (尝试失败) Text Justification
7. (尝试失败) word pattern 2
8. (尝试失败) Login Numbers Per Interval
遇到几道比较难的题目,尝试了很久没成功,明天接着做

评分

参与人数 1大米 +3 收起 理由
Sisyphustina + 3 楼主加油!看你一直坚持我灰常动力哈哈

查看全部评分

回复

使用道具 举报

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

本版积分规则

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