Python教程网
--左手Python,右手AI!

数据结构 | 刷Leetcode那点事

有一段时间没有更新 LeetCode 打卡帖了 ,其实自己有偶尔刷题 ,但是没有写成文章记录分享出来 ,主要还是自己懈怠了 ,另一个重要原因就是写这记录帖比较费事却没多少人看 。最近想了想 ,关于刷题做了一些浅显的思考 。

为什么刷题

首先 ,为什么刷题呢 ?当然是想着提高自身能力 ,在算法笔试面试中脱颖而出 。那么问题就来了 ,算法面试他面的只是一个具体的题目吗 ?

很显然不全是的 ,相信有人在面试中几乎做出了所有题却与 offer 擦肩而过 ,也有人并没有完美攻克所有题目却最终拿到了心仪的 offer 。至少和实验室有经验的学长同学沟通发现是有这样现象的 !

有人说 :算法面试优秀不意味着技术面试优秀 ,技术面试优秀不意味着能够拿到 offer 。的确是这样子 ,几个题目就能确定一个人的能力吗 ?不全然 !更多的时候 ,感觉技术面试不能局限于一个题目 ,局限于能否做出来正确结果 。而是考验一个人的思考方式和思考方向 。

举几个例子 。

第一 ,很多题目不只有一个解法 ,暴力穷举可以解决 ,巧妙技巧也并不缺乏 ,能否做出正确结果还真不是最关键的 。更优秀的代码(例如时间空间复杂度的优势)肯定更能吸引到面试官的注意也能从一定程度上证明你的过人之处 。

第二 ,许多题目会有多种特殊情况或者边界问题等 ,代码整体思路是对的 ,却总有通不过的样例 ?往往就是在这些特例上撞了墙 。再比如排序问题 ,方法很多 ,但是能简单的说快排就是最快的吗 ?事实上 ,数据的特征不同 ,采取不同的排序方法谁优谁劣真不一定 。有没有可能包含有大量重复的元素?原始数据有序度如何等等都值得思考 。

所以啊 ,平时还真不能局限于 ” 做出来就好 ” ,而是要多思考 ,多种思路并且更加全面才好 !小詹觉得面试官更加看重的也许就算思考能力和逻辑能力吧 。

怎么刷题

那么 ,怎么刷题呢 ?在线刷题系统其实不少 ,以 LeetCode 为例 ,难度分 3 档 ,并且每一题都有序号 ,是从前往后 ?还是从易到难 ?遇到难题 ,是死磕到底还是瞟一眼别人的代码 ?

其实每个人习惯和想法不一样 ,不好说哪一个更好 。小詹分享下自己的看法如下 。

刷题顺序

之前是粗暴的从前往后 ,但是自己想了想更推荐一个专题一个专题的进行 。比如数组 、链表 、队列 、动态规划等等 ,一个一个的攻克 ,没必要每一题都刷 ,挑一些经典的具有代表意义的 。以数组为例 ,题目使用较多的方法有二分 、双指针 、回溯等 ,就可以考虑每一类数据结构的每一种方法挑选几题仔细攻克 ,比广撒网也许更好一些 。

刷题习惯

遇到简单题目也许很快就有思路并写出来正确代码了 ,但是更加建议即使是简单的题目也思考下多种思路 。当然小詹推荐花大精力刷中等难度的题目 ,太简单和太困难的可以先放过 。遇到难题也不要马上就去看别人的代码 ,看懂别人的和自己写出来是两回事 ,先自己尝试思考 ,如果多种思路都尝试了依旧不行可以去看看别人的思路 ,看懂后最好自己复现一下 。

分析笔记

其实看对某个题的掌握程度最好方法就是让自己跟别人讲解分析 ,教会了别人 ,自己一定印象深刻 ,因为这会大脑思考转的非常快 !所以做笔记分析思路十个很不错的习惯 !

finally

一家之词 ,多多思考探索自己的方式 。也欢迎留言区分享你的刷题顺序 和技巧 ,也许能给别人带来一定启发噢 !

赞(3)
未经允许不得转载:Python教程网 » 数据结构 | 刷Leetcode那点事
分享到: 更多 (0)

评论 65

  1. #1

    A sudden twisting of the torso can be another cause, which will sometimes cause ligament damage as well.
    saleviabuy.com viagra connect usa

    匿名4个月前 (10-30)回复
  2. #2

    Can dengue fever effect verbal memory short term? https://llviabest.com viagra online sales

    匿名4个月前 (11-05)回复
  3. #3

    The vomiting response may be triggered by peripheral and central
    stimuli see figure 1. viagra online without prescription online viagra cheapest

    匿名4个月前 (11-06)回复
  4. #4

    age limit viagra https://purevigra.com/ comparativa viagra cialis o levitra

    匿名4个月前 (11-16)回复
  5. #5

    viagra dizziness para q sirve viagra viagra vision side effects

    匿名4个月前 (11-16)回复
  6. #6

    viagra no prescription paypal how much for viagra without insurance viagra without prescription canada

    匿名4个月前 (11-16)回复
  7. #7

    cheap viagra online viagra generic wholesale how much costs viagra in india

    匿名4个月前 (11-16)回复
  8. #8

    cheap pfizer viagra online paradiseviagira.com cheapest soft viagra

    匿名4个月前 (11-17)回复
  9. #9

    200 mg viagra india https://miraclevigra.com cheapest generic viagra prices online

    匿名3个月前 (11-20)回复
  10. #10

    Where can you buy viagra online safely https://mygoviagar.com price of
    sildenafil citrate

    匿名3个月前 (11-20)回复
  11. #11

    compare sildenafil prices sildenafil price canada viagra canada online price

    匿名3个月前 (11-21)回复
  12. #12

    viagra pharmacie en ligne https://buybuyviamen.com/ don’t need viagra

    匿名3个月前 (11-21)回复
  13. #13

    Order viagra 100mg hopeviagrin.com viagra uk paypal

    匿名3个月前 (11-21)回复
  14. #14

    sildenafil online coupon order viagra pills online viagra online order usa

    匿名3个月前 (11-21)回复
  15. #15

    stan tutaj viagra mp3 uso correcto del viagra viagra non prescription in canada

    匿名3个月前 (11-21)回复
  16. #16

    Viagra cream australia https://lightvigra.com/ brand viagra australia

    匿名3个月前 (11-21)回复
  17. #17

    viagra for women online rx pharmacy viagra get viagra prescription

    匿名3个月前 (11-25)回复
  18. #18

    essay help 50 first dates research paper economics research essays

    匿名3个月前 (11-29)回复
  19. #19

    writing an abstract for an essay help my essay cheap essay writer

    匿名3个月前 (11-29)回复
  20. #20

    write write an article review essays and research papers

    匿名3个月前 (11-29)回复
  21. #21

    Buy essay cheap buyessayhelpbtg.com buying essays

    匿名3个月前 (11-29)回复
  22. #22

    300 word college essay the importance of a college education essay dissertation writers uk

    匿名3个月前 (11-30)回复
  23. #23

    Cheap custom essays https://customessaywriterbyz.com/ custom essay writing canada

    匿名3个月前 (12-01)回复
  24. #24

    make a thesis do my english homework for me online essay writing help

    匿名3个月前 (12-02)回复
  25. #25

    Help in writing an essay https://essayhelpbgs.com/ online essay writing
    help

    匿名3个月前 (12-02)回复
  26. #26

    viagra onlone viagra special offers viagra online mastercard

    匿名3个月前 (12-02)回复
  27. #27

    Mba admission essay writing service https://essaywritingservicesjy.com/
    mba application essay writing service

    匿名3个月前 (12-02)回复
  28. #28

    college application essays university assignments for sale essay for nursing

    匿名3个月前 (12-03)回复
  29. #29

    presentations powerpoint uc admissions essay buy custom essay online

    匿名3个月前 (12-03)回复
  30. #30

    term paper writers writing essay website literature review on education

    匿名3个月前 (12-03)回复
  31. #31

    best price on cialis herbal cialis australia cialis viagra sales

    匿名3个月前 (12-09)回复
  32. #32

    viagra canada paypal payment buy viagra onlie viagra 50 mg generic buy

    匿名3个月前 (12-10)回复
  33. #33

    cialis..com cialis dapoxetine australia ver to bay cialis 20mg

    匿名3个月前 (12-10)回复
  34. #34

    viagra purchase without prescription viagra with dapoxetine viagra sildenafil

    匿名3个月前 (12-10)回复
  35. #35

    cialis trial pack what\’s better viagra cialis levitra cialis

    匿名3个月前 (12-12)回复
  36. #36

    Cialis https://gocialirx.com/ side effects
    of cialis

    匿名3个月前 (12-13)回复
  37. #37

    free cialis coupon cialis with dapoxetine overnight to how many milligrams of cialis can you take in a day ?

    匿名3个月前 (12-13)回复
  38. #38

    viagra results photos viagra free sample getting viagra in malaysia

    匿名3个月前 (12-13)回复
  39. #39

    order viagra online from canada viagra without prescription\’ generic viagra purchase with mastercard

    匿名3个月前 (12-14)回复
  40. #40

    viagrasales how to use viagra for men viagra paypal

    匿名3个月前 (12-14)回复
  41. #41

    Good post. I learn something totally new and challenging on sites I stumbleupon on a daily basis.
    It’s always useful to read content from other authors and use a little
    something from other sites.

    My site; xxx – onavie.sk,

    匿名2个月前 (12-22)回复
  42. #42

    Great info. Lucky me I ran across your website by accident (stumbleupon).
    I’ve saved it for later!

    Visit my page :: sex videos (astrakhan.pp.ru)

    匿名2个月前 (12-22)回复
  43. #43

    This website really has all of the information and facts I wanted about this subject and didn’t know who to ask.

    Also visit my site … xvideos4; http://www.zalivalcek.com/redirect.asp?url=https://anyxxx.com/search/slava-xxx/,

    匿名2个月前 (12-24)回复
  44. #44

    erectile dysfunction treatment rx express pharmacy erectile dysfunction

    匿名2个月前 (01-10)回复
  45. #45

    the peoples pharmacy legit online pharmacy ed meds online without doctor prescription

    匿名2个月前 (01-11)回复
  46. #46

    thrifty drug store canadian pharmacies nearest drugstore

    匿名2个月前 (01-11)回复
  47. #47

    med rx pharmacy texas state board of pharmacy mail order pharmacy

    匿名2个月前 (01-11)回复
  48. #48

    best drugstore setting powder pharmacy near me rx express pharmacy

    匿名2个月前 (01-12)回复
  49. #49

    pharmacy open near me pharm the peoples pharmacy

    匿名2个月前 (01-12)回复
  50. #50

    erectile online pharmacy viagra legit online pharmacy

    匿名2个月前 (01-12)回复
  51. #51

    india pharmacy erectile dysfunction medications erectile dysfunction medications

    匿名2个月前 (01-13)回复
  52. #52

    online pharmacy without scripts canadian pharmacy viagra cialis mexican pharmacy online

    匿名4周前 (02-06)回复
  53. #53

    canada prescriptions drugs canadadrugsonline eye drop

    匿名3周前 (02-08)回复
  54. #54

    canadian drugs online pharmacy canada pharmacies online pharmacy intern

    匿名3周前 (02-09)回复
  55. #55

    viagra australia coupons for viagra which is better viagra cialis or levitra

    匿名3周前 (02-10)回复
  56. #56

    viagra australia buy online boots viagra canadian pharmacies selling viagra to the united states

    匿名3周前 (02-11)回复
  57. #57

    discount viagra pharmacy buy viagra new zealand viagra 50mg price canada

    匿名3周前 (02-11)回复
  58. #58

    women taking cialis effects cialis class of drugs differenze levitra cialis

    匿名3周前 (02-13)回复
  59. #59

    citibank government travel card cash advance fees payday loans for unemployed south africa advantages of payday loan companies

    匿名3周前 (02-13)回复
  60. #60

    viagra under 50 achat viagra canada how do i get viagra for free

    匿名3周前 (02-13)回复
  61. #61

    money pig payday loan payday loan independent lender cash advance gaithersburg md

    匿名2周前 (02-15)回复
  62. #62

    cialis for bph dosage la cialis y el alcohol reacciones de la pastilla cialis

    匿名2周前 (02-16)回复
  63. #63

    sms fast cash loans cash advance willmar mn guaranteed approval payday loan direct lender

    匿名2周前 (02-17)回复
  64. #64

    p6ziy cybs1 bdt7

    匿名4天前回复
  65. #65

    red viagra pills can women take viagra how to order viagra

    匿名3天前回复