From bb377feb1c792413e8e360946e1f5fdb34efb419 Mon Sep 17 00:00:00 2001 From: aleen42 Date: Mon, 10 Oct 2016 22:34:13 +0800 Subject: [PATCH] update --- README-cn.md | 1024 ++++++++++++++++++++++++-------------------------- 1 file changed, 493 insertions(+), 531 deletions(-) diff --git a/README-cn.md b/README-cn.md index 2e6a941..4110eb7 100644 --- a/README-cn.md +++ b/README-cn.md @@ -1,52 +1,49 @@ -# Google Interview University +# Google Interview University - 一套完整的学习手册帮助自己准备 Google 的面试 -## What is it? +## 这是? -This is my multi-month study plan for going from web developer (self-taught, no CS degree) to Google software engineer. +这是我为了从 web 开发者(自学、非 CS 学位)蜕变至 Google 软件工程师所制定的计划,其内容历时数月。 -![Coding at the whiteboard - from HBO's Silicon Valley](https://dng5l3qzreal6.cloudfront.net/2016/Aug/coding_board_small-1470866369118.jpg) +![白板上编程 ———— 来自 HBO 频道的剧集,“硅谷”](https://dng5l3qzreal6.cloudfront.net/2016/Aug/coding_board_small-1470866369118.jpg) -This long list has been extracted and expanded from **Google's coaching notes**, so these are the things you need to know. -There are extra items I added at the bottom that may come up in the interview or be helpful in solving a problem. Many items are from -Steve Yegge's "[Get that job at Google](http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html)" and are reflected -sometimes word-for-word in Google's coaching notes. +这一长列表是从 **Google 的指导笔记** 中萃取出来并进行扩展。因此,有些事情你必须去了解一下。我在列表的底部添加了一些额外项,用于解决面试中可能会出现的问题。这些额外项大部分是来自 Steve Yegge 的“[得到在 Google 工作的机会](http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html)”,且有时会在 Google 指导笔记的逐字间反映出来。 --- -## Table of Contents +## 目录 -- [What is it?](#what-is-it) -- [Why use it?](#why-use-it) -- [How to use it](#how-to-use-it) -- [Get in a Googley Mood](#get-in-a-googley-mood) -- [Did I Get the Job?](#did-i-get-the-job) -- [Follow Along with Me](#follow-along-with-me) -- [Don't feel you aren't smart enough](#dont-feel-you-arent-smart-enough) -- [About Google](#about-google) -- [About Video Resources](#about-video-resources) -- [Interview Process & General Interview Prep](#interview-process--general-interview-prep) -- [Pick One Language for the Interview](#pick-one-language-for-the-interview) -- [Before you Get Started](#before-you-get-started) -- [What you Won't See Covered](#what-you-wont-see-covered) -- [Prerequisite Knowledge](#prerequisite-knowledge) -- [The Daily Plan](#the-daily-plan) -- [Algorithmic complexity / Big-O / Asymptotic analysis](#algorithmic-complexity--big-o--asymptotic-analysis) -- [Data Structures](#data-structures) - - [Arrays](#arrays) - - [Linked Lists](#linked-lists) - - [Stack](#stack) - - [Queue](#queue) - - [Hash table](#hash-table) -- [More Knowledge](#more-knowledge) - - [Binary search](#binary-search) - - [Bitwise operations](#bitwise-operations) -- [Trees](#trees) - - [Trees - Notes & Background](#trees---notes--background) - - [Binary search trees: BSTs](#binary-search-trees-bsts) - - [Heap / Priority Queue / Binary Heap](#heap--priority-queue--binary-heap) - - [Tries](#tries) - - [Balanced search trees](#balanced-search-trees) - - [N-ary (K-ary, M-ary) trees](#n-ary-k-ary-m-ary-trees) +- [这是?](#what-is-it) +- [为何要用到它?](#why-use-it) +- [如何使用它](#how-to-use-it) +- [拥有一名 Googler 的心态](#get-in-a-googley-mood) +- [我得到了工作吗?](#did-i-get-the-job) +- [跟随着我](#follow-along-with-me) +- [不要自以为自己足够聪明](#dont-feel-you-arent-smart-enough) +- [关于 Google](#about-google) +- [相关视频资源](#about-video-resources) +- [面试过程 & 通用的面试准备](#interview-process--general-interview-prep) +- [为你的面试选择一种语言](#pick-one-language-for-the-interview) +- [在你开始之前](#before-you-get-started) +- [你所看不到的](#what-you-wont-see-covered) +- [日常计划](#the-daily-plan) +- [必备知识](#prerequisite-knowledge) +- [算法复杂度 / Big-O / 渐进分析法](#algorithmic-complexity--big-o--asymptotic-analysis) +- [数据结构](#data-structures) + - [数组](#arrays) + - [链表](#linked-lists) + - [堆栈](#stack) + - [队列](#queue) + - [哈希表](#hash-table) +- [更多的知识](#more-knowledge) + - [二分查找](#binary-search) + - [按位运算](#bitwise-operations) +- [树](#trees) + - [树 —— 笔记 & 背景](#trees---notes--background) + - [二叉查找树: BSTs](#binary-search-trees-bsts) + - [堆 / 优先级队列 / 二叉堆](#heap--priority-queue--binary-heap) + - [字典树(Tries)](#tries) + - [平衡查找树](#balanced-search-trees) + - [N 叉树(K 叉树、M 叉树)](#n-ary-k-ary-m-ary-trees) - [Sorting](#sorting) - [Graphs](#graphs) - [Even More Knowledge](#even-more-knowledge) @@ -109,53 +106,43 @@ sometimes word-for-word in Google's coaching notes. --- -## Why use it? +## 为何要用到它? -I'm following this plan to prepare for my Google interview. I've been building the web, building -services, and launching startups since 1997. I have an economics degree, not a CS degree. I've -been very successful in my career, but I want to work at Google. I want to progress into larger systems -and get a real understanding of computer systems, algorithmic efficiency, data structure performance, -low-level languages, and how it all works. And if you don't know any of it, Google won't hire you. +我一直都是遵循该计划去准备 Google 的面试。自 1997 年以来,我一直从事于 web 程序的构建、服务器的构建及创业型公司的创办。对于只有着一个经济学学位,而不是计算机科学学位(CS degree)的我来说,在职业生涯中所取得的都非常成功。然而,我想在 Google 工作,并进入大型系统中,真正地去理解计算机系统、算法效率、数据结构性能、低级别编程语言及其工作原理。可一项都不了解的我,怎么会被 Google 所应聘呢? -When I started this project, I didn't know a stack from a heap, didn't know Big-O anything, anything about trees, or how to -traverse a graph. If I had to code a sorting algorithm, I can tell ya it wouldn't have been very good. -Every data structure I've ever used was built into the language, and I didn't know how they worked -under the hood at all. I've never had to manage memory, unless a process I was running would give an "out of -memory" error, and then I'd have to find a workaround. I've used a few multi-dimensional arrays in my life and -thousands of associative arrays, but I've never created data structures from scratch. +当我创建该项目时,我从一个栈到一个堆都并不了解。不懂得 Big-O 的任何东西、关于树的一切,或如何去遍历一个图。如果非要我去编写一个排序算法的话,我只能说我所写的并非十分巧妙。一直以来,任何我所用的数据结构都是内建于编程语言当中。至于它们在背后如何运作,我都一概不了解。此外,我并不需要管理内存。最多就是在一个正在执行的进程给出了“内存不足”的错误后,采取一些权变措施。在我的生活中,我甚少使用到多维的数组,可关联数组却成千上万。而且,从开始到现在,我都还未曾创建过数据结构。 -But after going through this study plan I have high confidence I'll be hired. It's a long plan. It's going to take me -months. If you are familiar with a lot of this already it will take you a lot less time. +然而,经过该学习计划,我已有足够的信心认为我能被 Google 所雇佣。这是一个花费了我数月的计划,若您已对大部分知识都熟悉的话,或许能节省大量的时间。 -## How to use it +## 如何使用它 -Everything below is an outline, and you should tackle the items in order from top to bottom. +下面所有的东西都是一个概述,而你需要根据从上到下的顺序逐一处理。 -I'm using Github's special markdown flavor, including tasks lists to check progress. +在学习过程中,我是使用 GitHub 特殊的 markdown flavor 语法去检查计划的进展,包括使用任务列表。 -- [x] Create a new branch so you can check items like this, just put an x in the brackets: [x] +- [x] 创建一个新的分支,以使得你可以像这样去检查每项。直接往方括号中填写一个字符 x:[x] -[More about Github-flavored markdown](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) +[关于 Github-flavored markdown 更多的详情](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) -## Get in a Googley Mood +## 拥有一名 Googler 的心态 -Print out a "[future Googler](https://github.com/jwasham/google-interview-university/blob/master/extras/future-googler.pdf)" sign (or two) and keep your eyes on the prize. +把一个(或两个)印有“[future Googler](https://github.com/jwasham/google-interview-university/blob/master/extras/future-googler.pdf)”的图案打印出来,并用你誓要成功的眼神盯着它。 [![future Googler sign](https://dng5l3qzreal6.cloudfront.net/2016/Oct/Screen_Shot_2016_10_04_at_10_13_24_AM-1475601104364.png)](https://github.com/jwasham/google-interview-university/blob/master/extras/future-googler.pdf) -## Did I Get the Job? +## 我得到了工作吗? -I haven't applied yet. +我还没去应聘。 -I still have a few days in the learning phase (finishing up this crazy list), and starting next week all -I'll be doing is programming questions all day long. That will continue for a few weeks, and then I'll -apply through a referral I've been holding onto since February (yes, February). +因为我离完成学习(完成该疯狂的计划列表)还需要数天的时间,并打算在下周开始用一整天的时间,以编程的方式去解决问题,而这将持续数周时间。然后,我才通过二月时得到的一个介绍资格去正式应聘(没错,是二月时得到的)。 - Thanks for the referral, JP. + 感谢 JP 的这次介绍。 -## Follow Along with Me +## 跟随着我 -I'm on the journey, too. Follow along on my blog at [GoogleyAsHeck.com](https://googleyasheck.com/) +目前我仍在该计划的执行过程中,如果,你想跟随我的脚步去学习,你可以登进我在 [GoogleyAsHeck.com](https://googleyasheck.com/) 上所写的博客。 + +下面是我的联系方式: - Twitter: [@googleyasheck](https://twitter.com/googleyasheck) - Twitter: [@StartupNextDoor](https://twitter.com/StartupNextDoor) @@ -164,549 +151,525 @@ I'm on the journey, too. Follow along on my blog at [GoogleyAsHeck.com](https:// ![John Washam - Google Interview University](https://dng5l3qzreal6.cloudfront.net/2016/Aug/book_stack_photo_resized_18_1469302751157-1472661280368.png) -## Don't feel you aren't smart enough -- Google engineers are smart, but many have an insecurity that they aren't smart enough, even though they work at Google. -- [The myth of the Genius Programmer](https://www.youtube.com/watch?v=0SARbwvhupQ) +## 不要自以为自己足够聪明 -## About Google +- Google 的工程师都是才智过人的。但是,就算是工作在 Google 的他们,仍然会因为自己不够聪明而感到一种不安全感。 +- [天才程序员的神话](https://www.youtube.com/watch?v=0SARbwvhupQ) -- [ ] For students - [Google Careers: Technical Development Guide](https://www.google.com/about/careers/students/guide-to-technical-development.html) -- [ ] How Search Works: - - [ ] [The Evolution of Search (video)](https://www.youtube.com/watch?v=mTBShTwCnD4) - - [ ] [How Search Works - the story](https://www.google.com/insidesearch/howsearchworks/thestory/) - - [ ] [How Search Works](https://www.google.com/insidesearch/howsearchworks/) - - [ ] [How Search Works - Matt Cutts (video)](https://www.youtube.com/watch?v=BNHR6IQJGZs) - - [ ] [How Google makes improvements to its search algorithm (video)](https://www.youtube.com/watch?v=J5RZOU6vK4Q) -- [ ] Series: - - [ ] [How Google Search Dealt With Mobile](https://backchannel.com/how-google-search-dealt-with-mobile-33bc09852dc9) - - [ ] [Google's Secret Study To Find Out Our Needs](https://backchannel.com/googles-secret-study-to-find-out-our-needs-eba8700263bf) - - [ ] [Google Search Will Be Your Next Brain](https://backchannel.com/google-search-will-be-your-next-brain-5207c26e4523) - - [ ] [The Deep Mind Of Demis Hassabis](https://backchannel.com/the-deep-mind-of-demis-hassabis-156112890d8a) -- [ ] [Book: How Google Works](https://www.amazon.com/How-Google-Works-Eric-Schmidt/dp/1455582344) -- [ ] [Made by Google announcement - Oct 2016 (video)](https://www.youtube.com/watch?v=q4y0KOeXViI) +## 关于 Google -## About Video Resources +- [ ] 面向学生 —— [Google 的职业生涯:技术开发指导](https://www.google.com/about/careers/students/guide-to-technical-development.html) +- [ ] Google 检索的原理: + - [ ] [Google 检索的发展史(视频)](https://www.youtube.com/watch?v=mTBShTwCnD4) + - [ ] [Google 检索的原理 —— 故事篇](https://www.google.com/insidesearch/howsearchworks/thestory/) + - [ ] [Google 检索的原理](https://www.google.com/insidesearch/howsearchworks/) + - [ ] [Google 检索的原理 —— Matt Cutts(视频)](https://www.youtube.com/watch?v=BNHR6IQJGZs) + - [ ] [Google 是如何改善其检索算法(视频)](https://www.youtube.com/watch?v=J5RZOU6vK4Q) +- [ ] 连载小说: + - [ ] [Google 检索是如何处理移动设备](https://backchannel.com/how-google-search-dealt-with-mobile-33bc09852dc9) + - [ ] [Google 用于寻找需求的秘密研究](https://backchannel.com/googles-secret-study-to-find-out-our-needs-eba8700263bf) + - [ ] [Google 检索将成为你的下一个大脑](https://backchannel.com/google-search-will-be-your-next-brain-5207c26e4523) + - [ ] [Demis Hassabis 的心灵深处](https://backchannel.com/the-deep-mind-of-demis-hassabis-156112890d8a) +- [ ] [书籍:Google 公司是如何运作的](https://www.amazon.com/How-Google-Works-Eric-Schmidt/dp/1455582344) +- [ ] [由 Google 通告所制作 —— 2016年10月(视频)](https://www.youtube.com/watch?v=q4y0KOeXViI) -Some videos are available only by enrolling in a Coursera, EdX, or Lynda.com class. These are called MOOCs. -It is free to do so, but sometimes the classes are not in session so you have to wait a couple of months, so you have no access. +## 相关视频资源 - I'd appreciate your help converting the MOOC video links to public sources to replace the online course videos over time. I like using university lectures. +部分视频只能通过在 Coursera、Edx 或 Lynda.com class 上注册登录才能观看。这些视频被称为网络公开课程(MOOC)。虽然,它们是免费观看。但是,部分课程可能不在该期间。因此,你需要多等待几个月。 + 我很感谢您能帮我把网络公开课程的视频链接转换成公开的视频源,以代替那些在线课程的视频。此外,一些大学的讲座视频也是我所青睐的。 -## Interview Process & General Interview Prep +## 面试过程 & 通用的面试准备 -- [ ] Videos: - - [ ] [How to Work at Google - Candidate Coaching Session (video)](https://www.youtube.com/watch?v=oWbUtlUhwa8&feature=youtu.be) - - [ ] [Google Recruiters Share Technical Interview Tips (video)](https://www.youtube.com/watch?v=qc1owf2-220&feature=youtu.be) - - [ ] [How to Work at Google: Tech Resume Preparation (video)](https://www.youtube.com/watch?v=8npJLXkcmu8) +- [ ] 视频: + - [ ] [如何在 Google 工作 —— 考生指导课程(视频)](https://www.youtube.com/watch?v=oWbUtlUhwa8&feature=youtu.be) + - [ ] [Google 招聘者所分享的技术面试小窍门(视频)](https://www.youtube.com/watch?v=qc1owf2-220&feature=youtu.be) + - [ ] [如何在 Google 工作:技术型简历的准备(视频)](https://www.youtube.com/watch?v=8npJLXkcmu8) -- [ ] Articles: - - [ ] [Becoming a Googler in Three Steps](http://www.google.com/about/careers/lifeatgoogle/hiringprocess/) - - [ ] [Get That Job at Google](http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html) - - all the things he mentions that you need to know are listed below - - [ ] _(very dated)_ [How To Get A Job At Google, Interview Questions, Hiring Process](http://dondodge.typepad.com/the_next_big_thing/2010/09/how-to-get-a-job-at-google-interview-questions-hiring-process.html) - - [ ] [Phone Screen Questions](http://sites.google.com/site/steveyegge2/five-essential-phone-screen-questions) +- [ ] 文章: + - [ ] [三步成为 Googler](http://www.google.com/about/careers/lifeatgoogle/hiringprocess/) + - [ ] [得到在 Google 的工作机会](http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html) + - 所有他所提及的事情都列在了下面 + - [ ] _(早已过期)_ [如何得到 Google 的一份工作,面试题,应聘过程](http://dondodge.typepad.com/the_next_big_thing/2010/09/how-to-get-a-job-at-google-interview-questions-hiring-process.html) + - [ ] [手机设备屏幕的问题](http://sites.google.com/site/steveyegge2/five-essential-phone-screen-questions) -- [ ] Additional (not suggested by Google but I added): - - [ ] [ABC: Always Be Coding](https://medium.com/always-be-coding/abc-always-be-coding-d5f8051afce2#.4heg8zvm4) - - [ ] [Four Steps To Google Without A Degree](https://medium.com/always-be-coding/four-steps-to-google-without-a-degree-8f381aa6bd5e#.asalo1vfx) - - [ ] [Whiteboarding](https://medium.com/@dpup/whiteboarding-4df873dbba2e#.hf6jn45g1) - - [ ] [How Google Thinks About Hiring, Management And Culture](http://www.kpcb.com/blog/lessons-learned-how-google-thinks-about-hiring-management-and-culture) - - [ ] [Effective Whiteboarding during Programming Interviews](http://www.coderust.com/blog/2014/04/10/effective-whiteboarding-during-programming-interviews/) - - [ ] Cracking The Coding Interview Set 1: - - [ ] [Gayle L McDowell - Cracking The Coding Interview (video)](https://www.youtube.com/watch?v=rEJzOhC5ZtQ) - - [ ] [Cracking the Coding Interview with Author Gayle Laakmann McDowell (video)](https://www.youtube.com/watch?v=aClxtDcdpsQ) - - [ ] How to Get a Job at the Big 4: - - [ ] ['How to Get a Job at the Big 4 - Amazon, Facebook, Google & Microsoft' (video)](https://www.youtube.com/watch?v=YJZCUhxNCv8) - - [ ] [Failing at Google Interviews](http://alexbowe.com/failing-at-google-interviews/) +- [ ] 附加的(虽然 Google 不建议,但我添加上来): + - [ ] [ABC:总处于编程状态(Always Be Coding)](https://medium.com/always-be-coding/abc-always-be-coding-d5f8051afce2#.4heg8zvm4) + - [ ] [四步成为 Google 一名没有学位的员工](https://medium.com/always-be-coding/four-steps-to-google-without-a-degree-8f381aa6bd5e#.asalo1vfx) + - [ ] [共享白板(Whiteboarding)](https://medium.com/@dpup/whiteboarding-4df873dbba2e#.hf6jn45g1) + - [ ] [Google 是如何看待应聘、管理和公司文化](http://www.kpcb.com/blog/lessons-learned-how-google-thinks-about-hiring-management-and-culture) + - [ ] [程序开发面试中有效的白板(Whiteboarding)](http://www.coderust.com/blog/2014/04/10/effective-whiteboarding-during-programming-interviews/) + - [ ] 震撼程序开发的面试第一集: + - [ ] [Gayle L McDowell —— 震撼程序开发的面试(视频)](https://www.youtube.com/watch?v=rEJzOhC5ZtQ) + - [ ] [震撼程序开发的面试 —— 作者 Gayle Laakmann McDowell(视频)](https://www.youtube.com/watch?v=aClxtDcdpsQ) + - [ ] 如何在世界四强企业中获得一份工作: + - [ ] [“如何在世界四强企业中获得一份工作 —— Amazon、Facebook、Google和Microsoft”(视频)](https://www.youtube.com/watch?v=YJZCUhxNCv8) + - [ ] [面试 Google 失败](http://alexbowe.com/failing-at-google-interviews/) -## Pick One Language for the Interview +## 为你的面试选择一种语言 -I wrote this short article about it: [Important: Pick One Language for the Google Interview](https://googleyasheck.com/important-pick-one-language-for-the-google-interview/) +在这,我就以下话题写一篇短文 —— [重点:为在 Google 的面试选择一种语言](https://googleyasheck.com/important-pick-one-language-for-the-google-interview/) -You can use a language you are comfortable in to do the coding part of the interview, but for Google, these are solid choices: +在大多数公司面试中的编程环节,你可以使用一种用起来较为舒适的语言。但在 Google,只有三种固定的选择: - C++ - Java - Python -You could also use these, but read around first. There may be caveats: +有时你也可以使用下面两种,但需要事先查阅说明。因为,说明中会有警告: - JavaScript - Ruby -You need to be very comfortable in the language, and be knowledgeable. +你需要对你所选择的语言感到非常舒适且足够了解。 + +关于选择的更多阅读: -Read more about choices: - http://www.byte-by-byte.com/choose-the-right-language-for-your-coding-interview/ - http://blog.codingforinterviews.com/best-programming-language-jobs/ - https://www.quora.com/What-is-the-best-language-to-program-in-for-an-in-person-Google-interview -[See language resources here](programming-language-resources.md) +[在此查看相关语言的资源](programming-language-resources.md) -You'll see some C, C++, and Python learning included below, because I'm learning. There are a few books involved, see the bottom. +由于,我正在学习C、C++ 和 Python,因此,在下面你会看到部分关于它们的学习资料。相关书籍请看文章的底部。 -## Before you Get Started +## 在你开始之前 -This list grew over many months, and yes, it kind of got out of hand. +该列表已经持续更新了很长时间,所以没错,它的确容易会失去控制。 -Here are some mistakes I made so you'll have a better experience. +这里列出一些我所犯过的错误,希望您不要重滔覆辙。 -### 1. You Won't Remember it All +### 1. 你不可能把所有的东西都记住 -I watched hours of videos and took copious notes, and months later there was much I didn't remember. I spent 3 days going -through my notes and making flashcards so I could review (see below). +我查看了数小时的视频,并记录了大量的笔记。可几个月后,我都忘却了其中的大部分东西。所以,我翻阅我的笔记,并将可回顾的东西制作成抽认卡(flashcard)(请往下看) -### 2. Use Flashcards +### 2. 使用抽认卡 -To solve the problem, I made a little flashcards site where I could add flashcards of 2 types: general and code. -Each card has different formatting. +为了解决善忘的问题,我制作了一些抽认卡页面,用于添加两种抽认卡:正常的及带代码的。每种卡都会有不同的格式设计。 -I made a mobile-first website so I could review on my phone and tablet, whereever I am. +而且,我还以移动设备优先去设计网页,以使得在任何地方,我都可以在我的手机及平板上回顾知识。 -Make your own for free: +你也可以免费制作数以你自己的网站: -- [Flashcards site repo](https://github.com/jwasham/computer-science-flash-cards) -- [My flash cards database](https://github.com/jwasham/computer-science-flash-cards/blob/master/cards-jwasham.db): Keep in mind I went overboard and have cards covering everything from assembly language and Python trivia to machine learning and statistics. It's way too much for what's required by Google. +- [抽认卡页面的代码仓库](https://github.com/jwasham/computer-science-flash-cards) +- [我的抽认卡数据库](https://github.com/jwasham/computer-science-flash-cards/blob/master/cards-jwasham.db):有一点需要记住的是,我做事有点过头,以至于把卡片覆盖到所有的东西上。从汇编语言和 Python 的细枝末节,到机器学习和统计。这种性格对于 Google 的要求来说,是的确有点多余。 -**Note on flashcards:** The first time you recognize you know the answer, don't mark it as known. You have to see the -same card and answer it several times correctly before you really know it. Repetition will put that knowledge deeper in -your brain. +**在抽认卡上做笔记:** 若你第一次发现你知道问题的答案时,不要急着把其标注成“已懂”。你需要做的是去查看是否有同样的抽认卡,并在你真正懂得如何解决问题之前,多问自己几次。重复地问答可帮助您深刻记住该知识点。 -### 3. Review, review, review +### 3. 回顾,回顾,回顾 -I keep a set of cheatsheets on ASCII, OSI stack, Big-O notations, and more. I study them when I have some spare time. +我留有一组 ASCII 码表、OSI 堆栈、Big-O 记号及更多的小抄纸,以便在空余的时候可以学习。 -Take a break from programming problems for a half hour and go through your flashcards. +每编程半个小时就要休息一下,并去回顾一下你的抽认卡。 -### 4. Focus +### 4. 专注 -There are a lot of distractions that can take up valuable time. Focus and concentration is hard. +在学习的过程中,往往会有许多令人分心的事情占据着我们宝贵的时间。因此,专注和集中注意力是非常的苦难的。 -## What you won't see covered +## 你所看不到的 -This big list all started as a personal to-do list made from Google interview coaching notes. These are prevalent -technologies but were not mentioned in those notes: +由于,这个巨大的列表是始于一个从 Google 面试指导笔记所形成的的个人事件处理列表。因此,有一些我熟悉且普遍的技术都未被谈及到: - SQL - Javascript - HTML, CSS, and other front-end technologies -## The Daily Plan +## 日常计划 -Some subjects take one day, and some will take multiple days. Some are just learning with nothing to implement. +部分问题可能会花费一天去学习,而部分则会花费都天。有些学习,则不需要使用代码去实现。 -Each day I take one subject from the list below, watch videos about that subject, and write an implementation in: - C - using structs and functions that take a struct * and something else as args. - C++ - without using built-in types - C++ - using built-in types, like STL's std::list for a linked list - Python - using built-in types (to keep practicing Python) - and write tests to ensure I'm doing it right, sometimes just using simple assert() statements - You may do Java or something else, this is just my thing. +因此,每一天我都会在下面所列出的列表中选择一个问题,并查看相关的视频。然后,使用以下的一种语言去实现: -Why code in all of these? - Practice, practice, practice, until I'm sick of it, and can do it with no problem (some have many edge cases and bookkeeping details to remember) - Work within the raw constraints (allocating/freeing memory without help of garbage collection (except Python)) - Make use of built-in types so I have experience using the built-in tools for real-world use (not going to write my own linked list implementation in production) + C —— 使用结构体和函数,该函数会接受一个结构体指针 * 及其他数据作为参数。 + C++ —— 不适用内建的数据类型。 + C++ —— 使用内建的数据类型,如使用 STL 的 std::list 来充当一个链表。 + Python —— 使用内建的数据类型(为了持续连续 Python),并编写一些测试去保证自己代码的正确性。有时,只需要使用断言函数 assert() 即可。 + 此外,你也可以使用 Java 或其他语言,这只是我的偏好而已。 -I may not have time to do all of these for every subject, but I'll try. +为何要在这些语言上都编程一次? -You can see my code here: + 因为可以练习,练习,练习,直至我已厌倦它,并毫无问题地完成它。(若有部分边缘条件没想到时,则用书写的形式记录下来并去记忆) + 因为可以在纯原生的条件下工作(不需垃圾回收机制的帮助下,分配/释放内存(除了 Python)) + 因为可以利用上内建的数据类型,以使得我拥有在现实世界中使用内建工具的经验(在生产环境中,不会去编码实现自己的链表) + +就算我没有时间去每一项都这么做,我也会尽我所能的。 + +在这里,你可以查看到我的代码: - [C] (https://github.com/jwasham/practice-c) - [C++] (https://github.com/jwasham/practice-cpp) - [Python] (https://github.com/jwasham/practice-python) -You don't need to memorize the guts of every algorithm. +你不需要记住每一个算法的内部原理。 -Write code on a whiteboard, not a computer. Test with some sample inputs. Then test it out on a computer. +在一个白板上写代码,而不要在一台计算机上编写。在测试完部分简单输入后,到计算机上再测试一下。 -## Prerequisite Knowledge +## 必备知识 -- [ ] **How computers process a program:** - - [ ] [How does CPU execute program (video)](https://www.youtube.com/watch?v=42KTvGYQYnA) - - [ ] [Machine Code Instructions (video)](https://www.youtube.com/watch?v=Mv2XQgpbTNE) +- [ ] **计算机是如何处理一段程序:** + - [ ] [CPU 是如何执行代码(视频)](https://www.youtube.com/watch?v=42KTvGYQYnA) + - [ ] [机器码指令(视频)](https://www.youtube.com/watch?v=Mv2XQgpbTNE) -- [ ] **Compilers** - - [ ] [How a Compiler Works in ~1 minute (video)](https://www.youtube.com/watch?v=IhC7sdYe-Jg) - - [ ] [Hardvard CS50 - Compilers (video)](https://www.youtube.com/watch?v=CSZLNYF4Klo) - - [ ] [C++ (video)](https://www.youtube.com/watch?v=twodd1KFfGk) - - [ ] [Understanding Compiler Optimization (C++) (video)](https://www.youtube.com/watch?v=FnGCDLhaxKU) +- [ ] **编译器** + - [ ] [编译器是如何在 ~1 分钟内工作(视频)](https://www.youtube.com/watch?v=IhC7sdYe-Jg) + - [ ] [Hardvard CS50 —— 编译器(视频)](https://www.youtube.com/watch?v=CSZLNYF4Klo) + - [ ] [C++(视频)](https://www.youtube.com/watch?v=twodd1KFfGk) + - [ ] [掌握编译器的优化(C++)(视频)](https://www.youtube.com/watch?v=FnGCDLhaxKU) -- [ ] **How floating point numbers are stored:** - - [ ] simple 8-bit: [Representation of Floating Point Numbers - 1 (video - there is an error in calculations - see video description)](https://www.youtube.com/watch?v=ji3SfClm8TU) - - [ ] 32 bit: [IEEE754 32-bit floating point binary (video)](https://www.youtube.com/watch?v=50ZYcZebIec) +- [ ] **浮点数是如何存储的:** + - [ ] 简单的 8-bit:[浮点数的表达形式 —— 1(视频 —— 在计算上有一个错误 —— 详情请查看视频的介绍)](https://www.youtube.com/watch?v=ji3SfClm8TU) + - [ ] 32 bit:[IEEE754 32-bit 浮点二进制(视频)](https://www.youtube.com/watch?v=50ZYcZebIec) -## Algorithmic complexity / Big-O / Asymptotic analysis -- nothing to implement -- [ ] [Harvard CS50 - Asymptotic Notation (video)](https://www.youtube.com/watch?v=iOq5kSKqeR4) -- [ ] [Big O Notations (general quick tutorial) (video)](https://www.youtube.com/watch?v=V6mKVRU1evU) -- [ ] [Big O Notation (and Omega and Theta) - best mathematical explanation (video)](https://www.youtube.com/watch?v=ei-A_wy5Yxw&index=2&list=PL1BaGV1cIH4UhkL8a9bJGG356covJ76qN) -- [ ] Skiena: - - [video](https://www.youtube.com/watch?v=gSyDMtdPNpU&index=2&list=PLOtl7M3yp-DV69F32zdK7YJcNXpTunF2b) - - [slides](http://www3.cs.stonybrook.edu/~algorith/video-lectures/2007/lecture2.pdf) -- [ ] [A Gentle Introduction to Algorithm Complexity Analysis](http://discrete.gr/complexity/) -- [ ] [Orders of Growth (video)](https://class.coursera.org/algorithmicthink1-004/lecture/59) -- [ ] [Asymptotics (video)](https://class.coursera.org/algorithmicthink1-004/lecture/61) -- [ ] [UC Berkeley Big O (video)](https://youtu.be/VIS4YDpuP98) -- [ ] [UC Berkeley Big Omega (video)](https://youtu.be/ca3e7UVmeUc) -- [ ] [Amortized Analysis (video)](https://www.youtube.com/watch?v=B3SpQZaAZP4&index=10&list=PL1BaGV1cIH4UhkL8a9bJGG356covJ76qN) -- [ ] [Illustrating "Big O" (video)](https://class.coursera.org/algorithmicthink1-004/lecture/63) +## 算法复杂度 / Big-O / 渐进分析法 +- 并不需要实现 +- [ ] [Harvard CS50 —— 渐进表示(视频)](https://www.youtube.com/watch?v=iOq5kSKqeR4) +- [ ] [Big O 记号(通用快速教程)(视频)](https://www.youtube.com/watch?v=V6mKVRU1evU) +- [ ] [Big O 记号(以及 Omega 和 Theta)—— 最佳数学解释(视频)](https://www.youtube.com/watch?v=ei-A_wy5Yxw&index=2&list=PL1BaGV1cIH4UhkL8a9bJGG356covJ76qN) +- [ ] Skiena 算法: + - [视频](https://www.youtube.com/watch?v=gSyDMtdPNpU&index=2&list=PLOtl7M3yp-DV69F32zdK7YJcNXpTunF2b) + - [幻灯片](http://www3.cs.stonybrook.edu/~algorith/video-lectures/2007/lecture2.pdf) +- [ ] [对于算法复杂度分析的一次详细介绍](http://discrete.gr/complexity/) +- [ ] [增长阶数(Orders of Growth)(视频)](https://class.coursera.org/algorithmicthink1-004/lecture/59) +- [ ] [渐进性(Asymptotics)(视频)](https://class.coursera.org/algorithmicthink1-004/lecture/61) +- [ ] [UC Berkeley Big O(视频)](https://youtu.be/VIS4YDpuP98) +- [ ] [UC Berkeley Big Omega(视频)](https://youtu.be/ca3e7UVmeUc) +- [ ] [摊提法分析(Amortized Analysis)(视频)](https://www.youtube.com/watch?v=B3SpQZaAZP4&index=10&list=PL1BaGV1cIH4UhkL8a9bJGG356covJ76qN) +- [ ] [举证“Big O”(视频)](https://class.coursera.org/algorithmicthink1-004/lecture/63) - [ ] TopCoder (includes recurrence relations and master theorem): - - [Computational Complexity: Section 1](https://www.topcoder.com/community/data-science/data-science-tutorials/computational-complexity-section-1/) - - [Computational Complexity: Section 2](https://www.topcoder.com/community/data-science/data-science-tutorials/computational-complexity-section-2/) -- [ ] [Cheat sheet](http://bigocheatsheet.com/) + - [计算性复杂度:第一部](https://www.topcoder.com/community/data-science/data-science-tutorials/computational-complexity-section-1/) + - [计算性复杂度:第二部](https://www.topcoder.com/community/data-science/data-science-tutorials/computational-complexity-section-2/) +- [ ] [速查表(Cheat sheet)](http://bigocheatsheet.com/) + 如果部分课程过于学术性,你可直接跳到文章底部,去查看离散数学的视频以获取相关背景知识。 - If some of the lectures are too mathy, you can jump down to the bottom and - watch the discrete mathematics videos to get the background knowledge. +## 数据结构 -## Data Structures - -- ### Arrays - - Implement an automatically resizing vector. - - [ ] Description: - - [Arrays (video)](https://www.coursera.org/learn/data-structures/lecture/OsBSF/arrays) - - [Basic Arrays (video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Basic-arrays/149042/177104-4.html) - - [Multi-dim (video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Multidimensional-arrays/149042/177105-4.html) - - [Dynamic Arrays (video)](https://www.coursera.org/learn/data-structures/lecture/EwbnV/dynamic-arrays) - - [Jagged Arrays (video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Jagged-arrays/149042/177106-4.html) - - [Resizing arrays (video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Resizable-arrays/149042/177108-4.html) - - [ ] Implement a vector (mutable array with automatic resizing): - - [ ] Practice coding using arrays and pointers, and pointer math to jump to an index instead of using indexing. - - [ ] new raw data array with allocated memory - - can allocate int array under the hood, just not use its features - - start with 16, or if starting number is greater, use power of 2 - 16, 32, 64, 128 - - [ ] size() - number of items - - [ ] capacity() - number of items it can hold +- ### 数组 + - 实现一个自动调整大小的动态数组。 + - [ ] 介绍: + - [数组(视频)](https://www.coursera.org/learn/data-structures/lecture/OsBSF/arrays) + - [基础数组(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Basic-arrays/149042/177104-4.html) + - [多维数组(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Multidimensional-arrays/149042/177105-4.html) + - [动态数组(视频)](https://www.coursera.org/learn/data-structures/lecture/EwbnV/dynamic-arrays) + - [不规则数组(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Jagged-arrays/149042/177106-4.html) + - [调整数组的大小(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Resizable-arrays/149042/177108-4.html) + - [ ] 实现一个动态数组(可自动调整大小的可变数组): + - [ ] 练习使用数组和指针去编码,并且指针是通过计算去跳转而不是使用索引 + - [ ] 通过分配内存来新建一个原生数据型数组 + - 可以使用 int 类型的数组,但不能使用其语法特性 + - 从大小为16或更大的数(使用2的倍数 —— 16、32、64、128)开始编写 + - [ ] size() —— 数组元素的个数 + - [ ] capacity() —— 可容纳元素的个数 - [ ] is_empty() - - [ ] at(index) - returns item at given index, blows up if index out of bounds + - [ ] at(index) —— 返回对应索引的元素,且若索引越界则愤然报错 - [ ] push(item) - - [ ] insert(index, item) - inserts item at index, shifts that index's value and trailing elements to the right - - [ ] prepend(item) - can use insert above at index 0 - - [ ] pop() - remove from end, return value - - [ ] delete(index) - delete item at index, shifting all trailing elements left - - [ ] remove(item) - looks for value and removes index holding it (even if in multiple places) - - [ ] find(item) - looks for value and returns first index with that value, -1 if not found - - [ ] resize(new_capacity) // private function - - when you reach capacity, resize to double the size - - when popping an item, if size is 1/4 of capacity, resize to half - - [ ] Time - - O(1) to add/remove at end (amortized for allocations for more space), index, or update - - O(n) to insert/remove elsewhere - - [ ] Space - - contiguous in memory, so proximity helps performance - - space needed = (array capacity, which is >= n) * size of item, but even if 2n, still O(n) + - [ ] insert(index, item) —— 在指定索引中插入元素,并把后面的元素依次后移 + - [ ] prepend(item) —— 可以使用上面的 insert 函数,传参 index 为 0 + - [ ] pop() —— 删除在数组末端元素,并返回其值 + - [ ] delete(index) —— 删除指定索引的元素,并把后面的元素依次前移 + - [ ] remove(item) —— 删除指定值的元素,并返回其索引(即使有多个元素) + - [ ] find(item) —— 寻找指定值的元素并返回其中第一个出现的元素其索引,若未找到则 + - [ ] resize(new_capacity) // 私有函数 + - 若数组到达其容积,则变大一倍 + - 当获取元素后,数组大小为其容积的1/4,则缩小一半 + - [ ] 时间复杂度 + - 在数组末端增加/删除、定位、更新元素,只允许占 O(1) 的时间复杂度(平摊(amortized)去分配内存以获取更多空间) + - 在数组任何地方插入/移除元素,只允许 O(n) 的时间复杂度 + - [ ] 空间复杂度 + - 因为在内存中分配的空间邻近,所以有助于提高性能 + - 空间需求 = (大于或等于 n 的数组容积)* 元素的大小。即便空间需求为 2n,其空间复杂度仍然是 O(n) -- ### Linked Lists - - [ ] Description: - - [ ] [Singly Linked Lists (video)](https://www.coursera.org/learn/data-structures/lecture/kHhgK/singly-linked-lists) - - [ ] [CS 61B - Linked Lists (video)](https://www.youtube.com/watch?v=sJtJOtXCW_M&list=PL-XXv-cvA_iAlnI-BQr9hjqADPBtujFJd&index=5) - - [ ] [C Code (video)](https://www.youtube.com/watch?v=QN6FPiD0Gzo) - - not the whole video, just portions about Node struct and memory allocation. - - [ ] Linked List vs Arrays: - - [Core Linked Lists Vs Arrays (video)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/rjBs9/core-linked-lists-vs-arrays) - - [In The Real World Linked Lists Vs Arrays (video)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/QUaUd/in-the-real-world-lists-vs-arrays) - - [ ] [why you should avoid linked lists (video)](https://www.youtube.com/watch?v=YQs6IC-vgmo) - - [ ] Gotcha: you need pointer to pointer knowledge: - (for when you pass a pointer to a function that may change the address where that pointer points) - This page is just to get a grasp on ptr to ptr. I don't recommend this list traversal style. Readability and maintainability suffer due to cleverness. - - [Pointers to Pointers](https://www.eskimo.com/~scs/cclass/int/sx8.html) - - [ ] implement (I did with tail pointer & without): - - [ ] size() - returns number of data elements in list - - [ ] empty() - bool returns true if empty - - [ ] value_at(index) - returns the value of the nth item (starting at 0 for first) - - [ ] push_front(value) - adds an item to the front of the list - - [ ] pop_front() - remove front item and return its value - - [ ] push_back(value) - adds an item at the end - - [ ] pop_back() - removes end item and returns its value - - [ ] front() - get value of front item - - [ ] back() - get value of end item - - [ ] insert(index, value) - insert value at index, so current item at that index is pointed to by new item at index - - [ ] erase(index) - removes node at given index - - [ ] value_n_from_end(n) - returns the value of the node at nth position from the end of the list - - [ ] reverse() - reverses the list - - [ ] remove_value(value) - removes the first item in the list with this value - - [ ] Doubly-linked List - - [Description (video)](https://www.coursera.org/learn/data-structures/lecture/jpGKD/doubly-linked-lists) - - No need to implement +- ### 链表 + - [ ] 介绍: + - [ ] [单向链表(视频)](https://www.coursera.org/learn/data-structures/lecture/kHhgK/singly-linked-lists) + - [ ] [CS 61B —— 链表(视频)](https://www.youtube.com/watch?v=sJtJOtXCW_M&list=PL-XXv-cvA_iAlnI-BQr9hjqADPBtujFJd&index=5) + - [ ] [C 代码(视频)](https://www.youtube.com/watch?v=QN6FPiD0Gzo) + - 并非看整个视频,而只是关于节点结果和内存分配那一部分 + - [ ] 链表 vs 数组: + - [核心链表 Vs 数组(视频)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/rjBs9/core-linked-lists-vs-arrays) + - [在现实世界中,链表 Vs 数组(视频)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/QUaUd/in-the-real-world-lists-vs-arrays) + - [ ] [为什么你需要避免使用链表(视频)](https://www.youtube.com/watch?v=YQs6IC-vgmo) + - [ ] Gotcha:你需要关于“指向指针的指针”的相关知识: + (因为当你传递一个指针到一个函数时,该函数可能会改变指针所指向的地址) + 该页只是为了让你了解“指向指针的指针”这一概念。但我并不推荐这种链式遍历的风格,因为,代码的可读性和可维护性太低。 + - [指向指针的指针](https://www.eskimo.com/~scs/cclass/int/sx8.html) + - [ ] 实现(我实现了使用尾指针以及没有使用这两种情况): + - [ ] size() —— 返回链表中数据元素的个数 + - [ ] empty() —— 若链表为空则返回一个布尔值 true + - [ ] value_at(index) —— 返回第 n 个元素的值(从0开始计算) + - [ ] push_front(value) —— 添加元素到链表的首部 + - [ ] pop_front() —— 删除首部元素并返回其值 + - [ ] push_back(value) —— 添加元素到链表的尾部 + - [ ] pop_back() —— 删除尾部元素并返回其值 + - [ ] front() —— 返回首部元素的值 + - [ ] back() —— 返回尾部元素的值 + - [ ] insert(index, value) —— 插入值到指定的索引,并且当前索引的元素指向到新的元素 index + - [ ] erase(index) —— 删除指定索引的节点 + - [ ] value_n_from_end(n) —— 返回倒数第 n 个节点的值 + - [ ] reverse() —— 逆序链表 + - [ ] remove_value(value) —— 删除链表中指定值的第一个元素 + - [ ] 双向链表 + - [介绍(视频)](https://www.coursera.org/learn/data-structures/lecture/jpGKD/doubly-linked-lists) + - 并不需要实现 -- ### Stack - - [ ] [Stacks (video)](https://www.coursera.org/learn/data-structures/lecture/UdKzQ/stacks) - - [ ] [Using Stacks Last-In First-Out (video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-stacks-last-first-out/149042/177120-4.html) - - [ ] Will not implement. Implementing with array is trivial. +- ### 堆栈 + - [ ] [堆栈(视频)](https://www.coursera.org/learn/data-structures/lecture/UdKzQ/stacks) + - [ ] [使用堆栈 —— 后进先出(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-stacks-last-first-out/149042/177120-4.html) + - [ ] 可以不实现,因为使用数组实现并不重要 -- ### Queue - - [ ] [Using Queues First-In First-Out(video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-queues-first-first-out/149042/177122-4.html) - - [ ] [Queue (video)](https://www.coursera.org/learn/data-structures/lecture/EShpq/queue) - - [ ] [Circular buffer/FIFO](https://en.wikipedia.org/wiki/Circular_buffer) - - [ ] [Priority Queues (video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Priority-queues-deques/149042/177123-4.html) - - [ ] Implement using linked-list, with tail pointer: - - enqueue(value) - adds value at position at tail - - dequeue() - returns value and removes least recently added element (front) +- ### 队列 + - [ ] [使用队列 —— 先进先出(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-queues-first-first-out/149042/177122-4.html) + - [ ] [队列(视频)](https://www.coursera.org/learn/data-structures/lecture/EShpq/queue) + - [ ] [原型队列/先进先出(FIFO)](https://en.wikipedia.org/wiki/Circular_buffer) + - [ ] [优先级队列(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Priority-queues-deques/149042/177123-4.html) + - [ ] 使用含有尾部指针链表实现: + - enqueue(value) —— 在尾部添加值 + - dequeue() —— 删除最早添加的元素并返回其值(首部元素) - empty() - - [ ] Implement using fixed-sized array: - - enqueue(value) - adds item at end of available storage - - dequeue() - returns value and removes least recently added element + - [ ] 使用固定大小的数组实现: + - enqueue(value) —— 在可容的情况下添加元素到尾部 + - dequeue() —— 删除最早添加的元素并返回其值 - empty() - full() - - [ ] Cost: - - a bad implementation using linked list where you enqueue at head and dequeue at tail would be O(n) - because you'd need the next to last element, causing a full traversal each dequeue - - enqueue: O(1) (amortized, linked list and array [probing]) - - dequeue: O(1) (linked list and array) - - empty: O(1) (linked list and array) - -- ### Hash table - - [ ] Videos: - - [ ] [Hashing with Chaining (video)](https://www.youtube.com/watch?v=0M_kIqhwbFo&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=8) - - [ ] [Table Doubling, Karp-Rabin (video)](https://www.youtube.com/watch?v=BRO7mVIFt08&index=9&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb) - - [ ] [Open Addressing, Cryptographic Hashing (video)](https://www.youtube.com/watch?v=rvdJDijO2Ro&index=10&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb) - - [ ] [PyCon 2010: The Mighty Dictionary (video)](https://www.youtube.com/watch?v=C4Kc8xzcA68) - - [ ] [(Advanced) Randomization: Universal & Perfect Hashing (video)](https://www.youtube.com/watch?v=z0lJ2k0sl1g&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp&index=11) - - [ ] [(Advanced) Perfect hashing (video)](https://www.youtube.com/watch?v=N0COwN14gt0&list=PL2B4EEwhKD-NbwZ4ezj7gyc_3yNrojKM9&index=4) - - - [ ] Online Courses: - - [ ] [Understanding Hash Functions (video](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Understanding-hash-functions/149042/177126-4.html) - - [ ] [Using Hash Tables (video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-hash-tables/149042/177127-4.html) - - [ ] [Supporting Hashing (video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Supporting-hashing/149042/177128-4.html) - - [ ] [Language Support Hash Tables (video)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Language-support-hash-tables/149042/177129-4.html) - - [ ] [Core Hash Tables (video)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/m7UuP/core-hash-tables) - - [ ] [Data Structures (video)](https://www.coursera.org/learn/data-structures/home/week/3) - - [ ] [Phone Book Problem (video)](https://www.coursera.org/learn/data-structures/lecture/NYZZP/phone-book-problem) - - [ ] distributed hash tables: - - [Instant Uploads And Storage Optimization In Dropbox (video)](https://www.coursera.org/learn/data-structures/lecture/DvaIb/instant-uploads-and-storage-optimization-in-dropbox) - - [Distributed Hash Tables (video)](https://www.coursera.org/learn/data-structures/lecture/tvH8H/distributed-hash-tables) - - - [ ] implement with array using linear probing - - hash(k, m) - m is size of hash table - - add(key, value) - if key already exists, update value + - [ ] 花销: + - 在使用链表的一个糟糕实现中,入列和出列的时间复杂度将会是 O(n) + 因为你需要找到下一个元素,以致循环整个队列 + - enqueue:O(1)(平摊(amortized)、链表和数组 [探测(probing)]) + - dequeue:O(1)(链表和数组) + - empty:O(1)(链表和数组) + +- ### 哈希表 + - [ ] 视频: + - [ ] [链式哈希表(视频)](https://www.youtube.com/watch?v=0M_kIqhwbFo&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=8) + - [ ] [Table Doubling 和 Karp-Rabin(视频)](https://www.youtube.com/watch?v=BRO7mVIFt08&index=9&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb) + - [ ] [Open Addressing 和 密码型哈希(Cryptographic Hashing)(视频)](https://www.youtube.com/watch?v=rvdJDijO2Ro&index=10&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb) + - [ ] [PyCon 2010:The Mighty Dictionary(视频)](https://www.youtube.com/watch?v=C4Kc8xzcA68) + - [ ] [(进阶)随机取样(Randomization):全域散列(Universal)& 完美散列(Perfect Hashing)(视频)](https://www.youtube.com/watch?v=z0lJ2k0sl1g&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp&index=11) + - [ ] [(进阶)完美散列(Perfect hashing)(视频)](https://www.youtube.com/watch?v=N0COwN14gt0&list=PL2B4EEwhKD-NbwZ4ezj7gyc_3yNrojKM9&index=4) + + - [ ] 在线课程: + - [ ] [哈希函数的掌握(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Understanding-hash-functions/149042/177126-4.html) + - [ ] [使用哈希表(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-hash-tables/149042/177127-4.html) + - [ ] [Supporting Hashing(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Supporting-hashing/149042/177128-4.html) + - [ ] [哈希表的语言支持(视频)](https://www.lynda.com/Developer-Programming-Foundations-tutorials/Language-support-hash-tables/149042/177129-4.html) + - [ ] [核心哈希表(视频)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/m7UuP/core-hash-tables) + - [ ] [数据结构(视频)](https://www.coursera.org/learn/data-structures/home/week/3) + - [ ] [电话薄问题(Phone Book Problem)(视频)](https://www.coursera.org/learn/data-structures/lecture/NYZZP/phone-book-problem) + - [ ] 分布式哈希表: + - [Dropbox 中的瞬时上传及存储优化(视频)](https://www.coursera.org/learn/data-structures/lecture/DvaIb/instant-uploads-and-storage-optimization-in-dropbox) + - [分布式哈希表(视频)](https://www.coursera.org/learn/data-structures/lecture/tvH8H/distributed-hash-tables) + + - [ ] 使用线性探测的数组去实现 + - hash(k, m) —— m 是哈希表的大小 + - add(key, value) —— 如果 key 已存在则更新值 - exists(key) - get(key) - remove(key) -## More Knowledge +## 更多的知识 -- ### Binary search - - [ ] [Binary Search (video)](https://www.youtube.com/watch?v=D5SrAga1pno) - - [ ] [Binary Search (video)](https://www.khanacademy.org/computing/computer-science/algorithms/binary-search/a/binary-search) - - [ ] [detail](https://www.topcoder.com/community/data-science/data-science-tutorials/binary-search/) - - [ ] Implement: - - binary search (on sorted array of integers) - - binary search using recursion +- ### 二分查找 + - [ ] [二分查找(视频)](https://www.youtube.com/watch?v=D5SrAga1pno) + - [ ] [二分查找(视频)](https://www.khanacademy.org/computing/computer-science/algorithms/binary-search/a/binary-search) + - [ ] [详情](https://www.topcoder.com/community/data-science/data-science-tutorials/binary-search/) + - [ ] 实现: + - 二分查找(在一个已排序好的整型数组中查找) + - 迭代式二分查找 -- ### Bitwise operations - - [ ] [Bits cheat sheet](https://github.com/jwasham/google-interview-university/blob/master/extras/cheat%20sheets/bits-cheat-cheet.pdf) - you should know many of the powers of 2 from (2^1 to 2^16 and 2^32) - - [ ] Get a really good understanding of manipulating bits with: &, |, ^, ~, >>, << - - [ ] [words](https://en.wikipedia.org/wiki/Word_(computer_architecture)) - - [ ] Good intro: - [Bit Manipulation (video)](https://www.youtube.com/watch?v=7jkIUgLC29I) - - [ ] [C Programming Tutorial 2-10: Bitwise Operators (video)](https://www.youtube.com/watch?v=d0AwjSpNXR0) - - [ ] [Bit Manipulation](https://en.wikipedia.org/wiki/Bit_manipulation) - - [ ] [Bitwise Operation](https://en.wikipedia.org/wiki/Bitwise_operation) +- ### 按位运算 + - [ ] [Bits 速查表](https://github.com/jwasham/google-interview-university/blob/master/extras/cheat%20sheets/bits-cheat-cheet.pdf) + - 你需要知道大量2的倍数其值(从2^1 到 2^16 及 2^32) + - [ ] 好好理解位运操作符的含义:&、|、^、~、>>、<< + - [ ] [字码(words)](https://en.wikipedia.org/wiki/Word_(computer_architecture)) + - [ ] 好的介绍: + [位操作(视频)](https://www.youtube.com/watch?v=7jkIUgLC29I) + - [ ] [C 语言编程教程 2-10:按位运算(视频)](https://www.youtube.com/watch?v=d0AwjSpNXR0) + - [ ] [位操作](https://en.wikipedia.org/wiki/Bit_manipulation) + - [ ] [按位运算](https://en.wikipedia.org/wiki/Bitwise_operation) - [ ] [Bithacks](https://graphics.stanford.edu/~seander/bithacks.html) - - [ ] [The Bit Twiddler](http://bits.stephan-brumme.com/) - - [ ] [The Bit Twiddler Interactive](http://bits.stephan-brumme.com/interactive.html) - - [ ] 2s and 1s complement - - [Binary: Plusses & Minuses (Why We Use Two's Complement) (video)](https://www.youtube.com/watch?v=lKTsv6iVxV4) - - [1s Complement](https://en.wikipedia.org/wiki/Ones%27_complement) - - [2s Complement](https://en.wikipedia.org/wiki/Two%27s_complement) - - [ ] count set bits - - [4 ways to count bits in a byte (video)](https://youtu.be/Hzuzo9NJrlc) + - [ ] [位元抚弄者(The Bit Twiddler)](http://bits.stephan-brumme.com/) + - [ ] [交互式位元抚弄者(The Bit Twiddler Interactive)](http://bits.stephan-brumme.com/interactive.html) + - [ ] 一补数和补码 + - [二进制:利 & 弊(为什么我们要使用补码)(视频)](https://www.youtube.com/watch?v=lKTsv6iVxV4) + - [一补数(1s Complement)](https://en.wikipedia.org/wiki/Ones%27_complement) + - [补码(2s Complement)](https://en.wikipedia.org/wiki/Two%27s_complement) + - [ ] 计算置位(Set Bits) + - [计算一个字节中置位(Set Bits)的四种方式(视频)](https://youtu.be/Hzuzo9NJrlc) - [Count Bits](https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan) - - [How To Count The Number Of Set Bits In a 32 Bit Integer](http://stackoverflow.com/questions/109023/how-to-count-the-number-of-set-bits-in-a-32-bit-integer) - - [ ] round to next power of 2: - - [Round Up To Next Power Of Two](http://bits.stephan-brumme.com/roundUpToNextPowerOfTwo.html) - - [ ] swap values: - - [Swap](http://bits.stephan-brumme.com/swap.html) - - [ ] absolute value: - - [Absolute Integer](http://bits.stephan-brumme.com/absInteger.html) + - [如何在一个 32 位的整型中计算置位(Set Bits)的数量](http://stackoverflow.com/questions/109023/how-to-count-the-number-of-set-bits-in-a-32-bit-integer) + - [ ] 四舍五入2的幂数: + - [四舍五入到2的下一幂数](http://bits.stephan-brumme.com/roundUpToNextPowerOfTwo.html) + - [ ] 交换值: + - [交换(Swap)](http://bits.stephan-brumme.com/swap.html) + - [ ] 绝对值: + - [绝对整型(Absolute Integer)](http://bits.stephan-brumme.com/absInteger.html) -## Trees +## 树 -- ### Trees - Notes & Background - - [ ] [Series: Core Trees (video)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/ovovP/core-trees) - - [ ] [Series: Trees (video)](https://www.coursera.org/learn/data-structures/lecture/95qda/trees) - - basic tree construction - - traversal - - manipulation algorithms - - BFS (breadth-first search) - - [MIT (video)](https://www.youtube.com/watch?v=s-CYnVz-uh4&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=13) - - level order (BFS, using queue) - time complexity: O(n) - space complexity: best: O(1), worst: O(n/2)=O(n) - - DFS (depth-first search) - - [MIT (video)](https://www.youtube.com/watch?v=AfSk24UTFS8&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=14) - - notes: - time complexity: O(n) - space complexity: - best: O(log n) - avg. height of tree - worst: O(n) - - inorder (DFS: left, self, right) - - postorder (DFS: left, right, self) - - preorder (DFS: self, left, right) +- ### 树 —— 笔记 & 背景 + - [ ] [系列:树结构的核心(视频)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/ovovP/core-trees) + - [ ] [系列:树(视频)](https://www.coursera.org/learn/data-structures/lecture/95qda/trees) + - 基本的树形结构 + - 遍历 + - 操作算法 + - BFS(广度优先检索,breadth-first search) + - [MIT(视频)](https://www.youtube.com/watch?v=s-CYnVz-uh4&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=13) + - 层序遍历(使用队列的 BFS 算法) + 时间复杂度: O(n) + 空间复杂度:最好情况: O(1),最坏情况:O(n/2)=O(n) + - DFS(深度优先检索,depth-first search) + - [MIT(视频)](https://www.youtube.com/watch?v=AfSk24UTFS8&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=14) + - 笔记: + 时间复杂度:O(n) + 空间复杂度: + 最好情况:O(log n) - 树的平均高度 + 最坏情况:O(n) + - 中序遍历(DFS:左、自己、右) + - 后序遍历(DFS:左、右、自己) + - 先序遍历(DFS:自己、左、右) -- ### Binary search trees: BSTs - - [ ] [Binary Search Tree Review (video)](https://www.youtube.com/watch?v=x6At0nzX92o&index=1&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) - - [ ] [Series (video)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/p82sw/core-introduction-to-binary-search-trees) - - starts with symbol table and goes through BST applications - - [ ] [Introduction (video)](https://www.coursera.org/learn/data-structures/lecture/E7cXP/introduction) - - [ ] [MIT (video)](https://www.youtube.com/watch?v=9Jry5-82I68) +- ### 二叉查找树: BSTs + - [ ] [二叉查找树概览(视频)](https://www.youtube.com/watch?v=x6At0nzX92o&index=1&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) + - [ ] [系列(视频)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/p82sw/core-introduction-to-binary-search-trees) + - 从符号表开始讲到 BST 程序 + - [ ] [介绍(视频)](https://www.coursera.org/learn/data-structures/lecture/E7cXP/introduction) + - [ ] [MIT(视频)](https://www.youtube.com/watch?v=9Jry5-82I68) - C/C++: - - [ ] [Binary search tree - Implementation in C/C++ (video)](https://www.youtube.com/watch?v=COZK7NATh4k&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=28) - - [ ] [BST implementation - memory allocation in stack and heap (video)](https://www.youtube.com/watch?v=hWokyBoo0aI&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=29) - - [ ] [Find min and max element in a binary search tree (video)](https://www.youtube.com/watch?v=Ut90klNN264&index=30&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) - - [ ] [Find height of a binary tree (video)](https://www.youtube.com/watch?v=_pnqMz5nrRs&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=31) - - [ ] [Binary tree traversal - breadth-first and depth-first strategies (video)](https://www.youtube.com/watch?v=9RHO6jU--GU&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=32) - - [ ] [Binary tree: Level Order Traversal (video)](https://www.youtube.com/watch?v=86g8jAQug04&index=33&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) - - [ ] [Binary tree traversal: Preorder, Inorder, Postorder (video)](https://www.youtube.com/watch?v=gm8DUJJhmY4&index=34&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) - - [ ] [Check if a binary tree is binary search tree or not (video)](https://www.youtube.com/watch?v=yEwSGhSsT0U&index=35&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) - - [ ] [Delete a node from Binary Search Tree (video)](https://www.youtube.com/watch?v=gcULXE7ViZw&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=36) - - [ ] [Inorder Successor in a binary search tree (video)](https://www.youtube.com/watch?v=5cPbNCrdotA&index=37&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) - - [ ] Implement: - - [ ] insert // insert value into tree - - [ ] get_node_count // get count of values stored - - [ ] print_values // prints the values in the tree, from min to max + - [ ] [二叉查找树 —— 在 C/C++ 中实现(视频)](https://www.youtube.com/watch?v=COZK7NATh4k&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=28) + - [ ] [BST 实现 —— 在堆栈和堆中的内存分配(视频)](https://www.youtube.com/watch?v=hWokyBoo0aI&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=29) + - [ ] [在二叉查找树中找到最小和最大的元素(视频)](https://www.youtube.com/watch?v=Ut90klNN264&index=30&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) + - [ ] [寻找二叉树的高度(视频)](https://www.youtube.com/watch?v=_pnqMz5nrRs&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=31) + - [ ] [二叉树的遍历 —— 广度优先和深度优先策略(视频)](https://www.youtube.com/watch?v=9RHO6jU--GU&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=32) + - [ ] [二叉树:层序遍历(视频)](https://www.youtube.com/watch?v=86g8jAQug04&index=33&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) + - [ ] [二叉树的遍历:先序、中序、后续(视频)](https://www.youtube.com/watch?v=gm8DUJJhmY4&index=34&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) + - [ ] [判断一棵二叉树是否是二叉查找树(视频)](https://www.youtube.com/watch?v=yEwSGhSsT0U&index=35&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) + - [ ] [从二叉查找树中删除一个节点(视频)](https://www.youtube.com/watch?v=gcULXE7ViZw&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=36) + - [ ] [二叉查找树中序遍历的后继者(视频)](https://www.youtube.com/watch?v=5cPbNCrdotA&index=37&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P) + - [ ] 实现: + - [ ] insert // 往树上插值 + - [ ] get_node_count // 查找树上的节点数 + - [ ] print_values // 从小到大打印树中节点的值 - [ ] delete_tree - - [ ] is_in_tree // returns true if given value exists in the tree - - [ ] get_height // returns the height in nodes (single node's height is 1) - - [ ] get_min // returns the minimum value stored in the tree - - [ ] get_max // returns the maximum value stored in the tree + - [ ] is_in_tree // 如果值存在于树中则返回 true + - [ ] get_height // 返回节点所在的高度(如果只有一个节点,那么高度则为1) + - [ ] get_min // 返回树上的最小值 + - [ ] get_max // 返回树上的最大值 - [ ] is_binary_search_tree - [ ] delete_value - - [ ] get_successor // returns next-highest value in tree after given value, -1 if none + - [ ] get_successor // 返回给定值的后继者,若没有则返回-1 -- ### Heap / Priority Queue / Binary Heap - - visualized as a tree, but is usually linear in storage (array, linked list) - - [ ] [Heap](https://en.wikipedia.org/wiki/Heap_(data_structure)) - - [ ] [Introduction (video)](https://www.coursera.org/learn/data-structures/lecture/2OpTs/introduction) - - [ ] [Naive Implementations (video)](https://www.coursera.org/learn/data-structures/lecture/z3l9N/naive-implementations) - - [ ] [Binary Trees (video)](https://www.coursera.org/learn/data-structures/lecture/GRV2q/binary-trees) - - [ ] [Tree Height Remark (video)](https://www.coursera.org/learn/data-structures/supplement/S5xxz/tree-height-remark) - - [ ] [Basic Operations (video)](https://www.coursera.org/learn/data-structures/lecture/0g1dl/basic-operations) - - [ ] [Complete Binary Trees (video)](https://www.coursera.org/learn/data-structures/lecture/gl5Ni/complete-binary-trees) - - [ ] [Pseudocode (video)](https://www.coursera.org/learn/data-structures/lecture/HxQo9/pseudocode) - - [ ] [Heap Sort - jumps to start (video)](https://youtu.be/odNJmw5TOEE?list=PLFDnELG9dpVxQCxuD-9BSy2E7BWY3t5Sm&t=3291) - - [ ] [Heap Sort (video)](https://www.coursera.org/learn/data-structures/lecture/hSzMO/heap-sort) - - [ ] [Building a heap (video)](https://www.coursera.org/learn/data-structures/lecture/dwrOS/building-a-heap) - - [ ] [MIT: Heaps and Heap Sort (video)](https://www.youtube.com/watch?v=B7hVxCmfPtM&index=4&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb) - - [ ] [CS 61B Lecture 24: Priority Queues (video)](https://www.youtube.com/watch?v=yIUFT6AKBGE&index=24&list=PL4BBB74C7D2A1049C) - - [ ] [Linear Time BuildHeap (max-heap)](https://www.youtube.com/watch?v=MiyLo8adrWw) - - [ ] Implement a max-heap: +- ### 堆 / 优先级队列 / 二叉堆 + - 可视化是一棵树,但通常是以线性的形式存储(数组、链表) + - [ ] [堆](https://en.wikipedia.org/wiki/Heap_(data_structure)) + - [ ] [介绍(视频)](https://www.coursera.org/learn/data-structures/lecture/2OpTs/introduction) + - [ ] [无知的实现(视频)](https://www.coursera.org/learn/data-structures/lecture/z3l9N/naive-implementations) + - [ ] [二叉树(视频)](https://www.coursera.org/learn/data-structures/lecture/GRV2q/binary-trees) + - [ ] [关于树高的讨论(视频)](https://www.coursera.org/learn/data-structures/supplement/S5xxz/tree-height-remark) + - [ ] [基本操作(视频)](https://www.coursera.org/learn/data-structures/lecture/0g1dl/basic-operations) + - [ ] [完全二叉树(视频)](https://www.coursera.org/learn/data-structures/lecture/gl5Ni/complete-binary-trees) + - [ ] [伪代码(视频)](https://www.coursera.org/learn/data-structures/lecture/HxQo9/pseudocode) + - [ ] [堆排序 —— 跳到起点(视频)](https://youtu.be/odNJmw5TOEE?list=PLFDnELG9dpVxQCxuD-9BSy2E7BWY3t5Sm&t=3291) + - [ ] [堆排序(视频)](https://www.coursera.org/learn/data-structures/lecture/hSzMO/heap-sort) + - [ ] [构建一个堆(视频)](https://www.coursera.org/learn/data-structures/lecture/dwrOS/building-a-heap) + - [ ] [MIT:堆与堆排序(视频)](https://www.youtube.com/watch?v=B7hVxCmfPtM&index=4&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb) + - [ ] [CS 61B Lecture 24:优先级队列(视频)](https://www.youtube.com/watch?v=yIUFT6AKBGE&index=24&list=PL4BBB74C7D2A1049C) + - [ ] [线性时间复杂度的堆构建(大顶堆)](https://www.youtube.com/watch?v=MiyLo8adrWw) + - [ ] 实现一个大顶堆: - [ ] insert - - [ ] sift_up - needed for insert - - [ ] get_max - returns the max item, without removing it - - [ ] get_size() - return number of elements stored - - [ ] is_empty() - returns true if heap contains no elements - - [ ] extract_max - returns the max item, removing it - - [ ] sift_down - needed for extract_max - - [ ] remove(i) - removes item at index x - - [ ] heapify - create a heap from an array of elements, needed for heap_sort - - [ ] heap_sort() - take an unsorted array and turn it into a sorted array in-place using a max heap - - note: using a min heap instead would save operations, but double the space needed (cannot do in-place). + - [ ] sift_up —— 用于插入元素 + - [ ] get_max —— 返回最大值但不移除 + - [ ] get_size() —— 返回存储的元素数量 + - [ ] is_empty() —— 若堆为空则返回 true + - [ ] extract_max —— 返回最大值并移除它 + - [ ] sift_down —— 用于获取最大值元素 + - [ ] remove(i) —— 删除指定索引的元素 + - [ ] heapify —— 构件堆,用于堆排序 + - [ ] heap_sort() —— 拿到一个未排序的数组,然后使用大顶堆进行就地排序 + - 注意:若用小顶堆可节省操作,但导致空间复杂度加倍。(无法做到就地) -- ### Tries - - Note there are different kinds of tries. Some have prefixes, some don't, and some use string instead of bits - to track the path. - - I read through code, but will not implement. - - [ ] [Notes on Data Structures and Programming Techniques](http://www.cs.yale.edu/homes/aspnes/classes/223/notes.html#Tries) - - [ ] Short course videos: - - [ ] [Introduction To Tries (video)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/08Xyf/core-introduction-to-tries) - - [ ] [Performance Of Tries (video)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/PvlZW/core-performance-of-tries) - - [ ] [Implementing A Trie (video)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/DFvd3/core-implementing-a-trie) - - [ ] [The Trie: A Neglected Data Structure](https://www.toptal.com/java/the-trie-a-neglected-data-structure) - - [ ] [TopCoder - Using Tries](https://www.topcoder.com/community/data-science/data-science-tutorials/using-tries/) - - [ ] [Stanford Lecture (real world use case) (video)](https://www.youtube.com/watch?v=TJ8SkcUSdbU) - - [ ] [MIT, Advanced Data Structures, Strings (can get pretty obscure about halfway through)](https://www.youtube.com/watch?v=NinWEPPrkDQ&index=16&list=PLUl4u3cNGP61hsJNdULdudlRL493b-XZf) +- ### 字典树(Tries) + - 需要注意的是,字典树各式各样。有些有前缀,而有些则没有。有些使用字符串而不使用比特位来追踪路径。 + - 阅读代码,但不实现。 + - [ ] [数据结构笔记及编程技术](http://www.cs.yale.edu/homes/aspnes/classes/223/notes.html#Tries) + - [ ] 短课程视频: + - [ ] [对字典树(Tries)的介绍(视频)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/08Xyf/core-introduction-to-tries) + - [ ] [字典树(Tries)的性能(视频)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/PvlZW/core-performance-of-tries) + - [ ] [实现一棵字典树(Tries)(视频)](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/DFvd3/core-implementing-a-trie) + - [ ] [字典树(Tries):一个被忽略的数据结构](https://www.toptal.com/java/the-trie-a-neglected-data-structure) + - [ ] [高级编程人员 —— 使用字典树(Tries)](https://www.topcoder.com/community/data-science/data-science-tutorials/using-tries/) + - [ ] [标准教程(现实中的用例)(视频)](https://www.youtube.com/watch?v=TJ8SkcUSdbU) + - [ ] [MIT,高阶数据结构,字符串(可事半功倍)](https://www.youtube.com/watch?v=NinWEPPrkDQ&index=16&list=PLUl4u3cNGP61hsJNdULdudlRL493b-XZf) -- ### Balanced search trees - - Know least one type of balanced binary tree (and know how it's implemented): - - "Among balanced search trees, AVL and 2/3 trees are now passé, and red-black trees seem to be more popular. - A particularly interesting self-organizing data structure is the splay tree, which uses rotations - to move any accessed key to the root." - Skiena - - Of these, I chose to implement a splay tree. From what I've read, you won't implement a - balanced search tree in your interview. But I wanted exposure to coding one up - and let's face it, splay trees are the bee's knees. I did read a lot of red-black tree code. - - splay tree: insert, search, delete functions - If you end up implementing red/black tree try just these: - - search and insertion functions, skipping delete - - I want to learn more about B-Tree since it's used so widely with very large data sets. - - [ ] [Self-balancing binary search tree](https://en.wikipedia.org/wiki/Self-balancing_binary_search_tree) +- ### 平衡查找树 + - 掌握至少一种平衡查找树(并懂得如何实现): + - “在各种平衡查找树当中,AVL 和2-3树已经成为了过去,而红黑树(red-black trees)看似变得越来越受人青睐。 + 这种特别令人感兴趣的数据结构,叫伸展树(splay tree)。该数据结构可自我管理,且会使用轮换来移除任何访问过根节点的 key。 + ” —— Skiena + - 因此,在各种各样的平衡查找树当中,我选择了伸展树来实现。通过我的阅读,我发现你并不会在你的面试中被要求实现一棵 + 平衡搜索树。但是,我希望胜人一筹,因此让我们来面对该类树的实现吧。伸展树的确是更高质量的一种实现,因为我的确阅读了 + 大量关于红黑树的代码。 + - 伸展树:插入、查找、删除函数的实现 + ,而如果你最终实现了红黑树,那么请尝试一下: + - 跳过删除函数,直接实现搜索和插入功能 + - 我希望能阅读到更多关于 B 树的资料,因为它被广泛地应用到大型的数据集中。 + - [ ] [自我平衡二叉寻找树](https://en.wikipedia.org/wiki/Self-balancing_binary_search_tree) - - [ ] **AVL trees** - - In practice: - From what I can tell, these aren't used much in practice, but I could see where they would be: - The AVL tree is another structure supporting O(log n) search, insertion, and removal. It is more rigidly - balanced than red–black trees, leading to slower insertion and removal but faster retrieval. This makes it - attractive for data structures that may be built once and loaded without reconstruction, such as language - dictionaries (or program dictionaries, such as the opcodes of an assembler or interpreter). - - [ ] [MIT AVL Trees / AVL Sort (video)](https://www.youtube.com/watch?v=FNeL18KsWPc&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=6) - - [ ] [AVL Trees (video)](https://www.coursera.org/learn/data-structures/lecture/Qq5E0/avl-trees) - - [ ] [AVL Tree Implementation (video)](https://www.coursera.org/learn/data-structures/lecture/PKEBC/avl-tree-implementation) - - [ ] [Split And Merge](https://www.coursera.org/learn/data-structures/lecture/22BgE/split-and-merge) + - [ ] **AVL 树** + - 实际中: + 我能告诉你的事,该种树在实际中并无太多的用途,但我能看到有用的地方在哪里: + AVL 树是另一种结构,可支持时间复杂度为 O(log n) 的查询、插入及删除。它比红黑树严格意义上更要平衡,从而导致更慢的插入和删除,但遍历快。正因如此,才彰显其结构的魅力。只需要构建一次,就可以在不重新构造的情况下读取,例如语言字典(或程序字典,如一个汇编程序或解释程序的操作码)。 + - [ ] [MIT AVL 树 / AVL 树的排序(视频)](https://www.youtube.com/watch?v=FNeL18KsWPc&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=6) + - [ ] [AVL 树(视频)](https://www.coursera.org/learn/data-structures/lecture/Qq5E0/avl-trees) + - [ ] [AVL 树的实现(视频)](https://www.coursera.org/learn/data-structures/lecture/PKEBC/avl-tree-implementation) + - [ ] [分离与合并](https://www.coursera.org/learn/data-structures/lecture/22BgE/split-and-merge) - - [ ] **Splay trees** - - In practice: - Splay trees are typically used in the implementation of caches, memory allocators, routers, garbage collectors, - data compression, ropes (replacement of string used for long text strings), in Windows NT (in the virtual memory, - networking, and file system code) etc. - - [ ] [CS 61B: Splay Trees (video)](https://www.youtube.com/watch?v=Najzh1rYQTo&index=23&list=PL-XXv-cvA_iAlnI-BQr9hjqADPBtujFJd) - - [ ] MIT Lecture: Splay Trees: - - Gets very mathy, but watch the last 10 minutes for sure. - - [Video](https://www.youtube.com/watch?v=QnPl_Y6EqMo) + - [ ] **伸展树** + - 实际中: + 伸展树一般用于缓存、内存分配者、路由器、垃圾回收者、数据压缩、ropes(字符串的一种替代品,用于存储长串的文本字符)、Windows NT(虚拟内存、网络及文件系统)等的实现。 + - [ ] [CS 61B:伸展树(Splay trees)(视频)](https://www.youtube.com/watch?v=Najzh1rYQTo&index=23&list=PL-XXv-cvA_iAlnI-BQr9hjqADPBtujFJd) + - [ ] MIT 教程:伸展树(Splay trees): + - 该教程会过于学术,但请观看到最后的10分钟以确保掌握。 + - [视频](https://www.youtube.com/watch?v=QnPl_Y6EqMo) - - [ ] **2-3 search trees** - - In practice: - 2-3 trees have faster inserts at the expense of slower searches (since height is more compared to AVL trees). - - You would use 2-3 tree very rarely because its implementation involves different types of nodes. Instead, people use Red Black trees. - - [ ] [23-Tree Intuition and Definition (video)](https://www.youtube.com/watch?v=C3SsdUqasD4&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6&index=2) - - [ ] [Binary View of 23-Tree](https://www.youtube.com/watch?v=iYvBtGKsqSg&index=3&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) - - [ ] [2-3 Trees (student recitation) (video)](https://www.youtube.com/watch?v=TOb1tuEZ2X4&index=5&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp) + - [ ] **2-3查找树** + - 实际中: + 2-3树有着快速的插入,但却有着查询慢的代价(因为相比较 AVL 树来说,其高度更高)。 + - 你会很少用到2-3树。这是因为其实现涉及到不同类型的节点。因此,人们会选择红黑树。 + - [ ] [2-3树的直感与定义(视频)](https://www.youtube.com/watch?v=C3SsdUqasD4&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6&index=2) + - [ ] [2-3树的二元观点](https://www.youtube.com/watch?v=iYvBtGKsqSg&index=3&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) + - [ ] [2-3树(学生叙述)(视频)](https://www.youtube.com/watch?v=TOb1tuEZ2X4&index=5&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp) - - [ ] **2-3-4 Trees (aka 2-4 trees)** - - In practice: - For every 2-4 tree, there are corresponding red–black trees with data elements in the same order. The insertion and deletion - operations on 2-4 trees are also equivalent to color-flipping and rotations in red–black trees. This makes 2-4 trees an - important tool for understanding the logic behind red–black trees, and this is why many introductory algorithm texts introduce - 2-4 trees just before red–black trees, even though **2-4 trees are not often used in practice**. - - [ ] [CS 61B Lecture 26: Balanced Search Trees (video)](https://www.youtube.com/watch?v=zqrqYXkth6Q&index=26&list=PL4BBB74C7D2A1049C) - - [ ] [Bottom Up 234-Trees (video)](https://www.youtube.com/watch?v=DQdMYevEyE4&index=4&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) - - [ ] [Top Down 234-Trees (video)](https://www.youtube.com/watch?v=2679VQ26Fp4&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6&index=5) + - [ ] **2-3-4树 (亦称2-4树)** + - 实际中: + 对于每一棵2-4树,都有着对应的红黑树来存储同样顺序的数据元素。在2-4树上进行插入及删除操作等同于在红黑树上进行颜色翻转及轮换。这使得2-4树成为一种用于掌握红黑树背后逻辑的重要工具。这就是为什么许多算法引导文章都会在介绍红黑树之前,先介绍2-4树,尽管**2-4树在实际中并不经常使用**。 + - [ ] [CS 61B Lecture 26:平衡查找树(视频)](https://www.youtube.com/watch?v=zqrqYXkth6Q&index=26&list=PL4BBB74C7D2A1049C) + - [ ] [自底向上的2-4树(视频)](https://www.youtube.com/watch?v=DQdMYevEyE4&index=4&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) + - [ ] [自顶向下的2-4树(视频)](https://www.youtube.com/watch?v=2679VQ26Fp4&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6&index=5) - - [ ] **B-Trees** - - fun fact: it's a mystery, but the B could stand for Boeing, Balanced, or Bayer (co-inventor) - - In Practice: - B-Trees are widely used in databases. Most modern filesystems use B-trees (or Variants). In addition to - its use in databases, the B-tree is also used in filesystems to allow quick random access to an arbitrary - block in a particular file. The basic problem is turning the file block i address into a disk block - (or perhaps to a cylinder-head-sector) address. - - [ ] [B-Tree](https://en.wikipedia.org/wiki/B-tree) - - [ ] [Introduction to B-Trees (video)](https://www.youtube.com/watch?v=I22wEC1tTGo&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6&index=6) - - [ ] [B-Tree Definition and Insertion (video)](https://www.youtube.com/watch?v=s3bCdZGrgpA&index=7&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) - - [ ] [B-Tree Deletion (video)](https://www.youtube.com/watch?v=svfnVhJOfMc&index=8&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) - - [ ] [MIT 6.851 - Memory Hierarchy Models (video)](https://www.youtube.com/watch?v=V3omVLzI0WE&index=7&list=PLUl4u3cNGP61hsJNdULdudlRL493b-XZf) - - covers cache-oblivious B-Trees, very interesting data structures - - the first 37 minutes are very technical, may be skipped (B is block size, cache line size) + - [ ] **B 树** + - 有趣的是:为啥叫 B 仍然是一个神秘,因为 B 可代表波音(Boeing)、平衡(Balanced)或 Bayer(联合创造者) + - 实际中: + B 树会被广泛适用于数据库中,而现代大多数的文件系统都会使用到这种树(或变种)。除了运用在数据库中,B 树也会被用于文件系统以快速访问一个文件的任意块。但存在着一个基本的问题,那就是如何将文件块 i 转换成一个硬盘块(或一个柱面-磁头-扇区)上的地址。 + - [ ] [B 树](https://en.wikipedia.org/wiki/B-tree) + - [ ] [B 树的介绍(视频)](https://www.youtube.com/watch?v=I22wEC1tTGo&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6&index=6) + - [ ] [B 树的定义及其插入操作(视频)](https://www.youtube.com/watch?v=s3bCdZGrgpA&index=7&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) + - [ ] [B 树的删除操作(视频)](https://www.youtube.com/watch?v=svfnVhJOfMc&index=8&list=PLA5Lqm4uh9Bbq-E0ZnqTIa8LRaL77ica6) + - [ ] [MIT 6.851 —— 内存层次模块(Memory Hierarchy Models)(视频)](https://www.youtube.com/watch?v=V3omVLzI0WE&index=7&list=PLUl4u3cNGP61hsJNdULdudlRL493b-XZf) + - 覆盖有高速缓存参数无关型(cache-oblivious) B 树和非常有趣的数据结构 + - 头37分钟讲述的很专业,或许可以跳过(B 指块的大小、即缓存行的大小) - - [ ] **Red/black trees** - - In practice: - Red–black trees offer worst-case guarantees for insertion time, deletion time, and search time. - Not only does this make them valuable in time-sensitive applications such as real-time applications, - but it makes them valuable building blocks in other data structures which provide worst-case guarantees; - for example, many data structures used in computational geometry can be based on red–black trees, and - the Completely Fair Scheduler used in current Linux kernels uses red–black trees. In the version 8 of Java, - the Collection HashMap has been modified such that instead of using a LinkedList to store identical elements with poor - hashcodes, a Red-Black tree is used. - - [ ] [Aduni - Algorithms - Lecture 4 - (link jumps to starting point) (video)](https://youtu.be/1W3x0f_RmUo?list=PLFDnELG9dpVxQCxuD-9BSy2E7BWY3t5Sm&t=3871) - - [ ] [Aduni - Algorithms - Lecture 5 (video)](https://www.youtube.com/watch?v=hm2GHwyKF1o&list=PLFDnELG9dpVxQCxuD-9BSy2E7BWY3t5Sm&index=5) - - [ ] [Black Tree](https://en.wikipedia.org/wiki/Red%E2%80%93black_tree) - - [ ] [An Introduction To Binary Search And Red Black Tree](https://www.topcoder.com/community/data-science/data-science-tutorials/an-introduction-to-binary-search-and-red-black-trees/) + - [ ] **红黑树** + - 实际中: + 红黑树提供了在最坏情况下插入操作、删除操作和查找操作的时间保证。这些时间值的保障不仅对时间敏感型应用有用,例如实时应用。而且,还对在其他数据结构中构建块非常有用,而这些数据结构都提供了最坏情况下的保障;例如,许多用于计算几何学的数据结构都可以基于红黑树,而目前 Linux 系统所采用的完全公平调度器(the Completely Fair Scheduler)也使用到了该种树。在 Java 的版本8中,红黑树也被用于存储哈希列表集合中相同的数据,而不是使用链表及哈希码。 + - [ ] [Aduni —— 算法 —— 课程4(该链接直接跳到开始部分)(视频)](https://youtu.be/1W3x0f_RmUo?list=PLFDnELG9dpVxQCxuD-9BSy2E7BWY3t5Sm&t=3871) + - [ ] [Aduni —— 算法 —— 课程5(视频)](https://www.youtube.com/watch?v=hm2GHwyKF1o&list=PLFDnELG9dpVxQCxuD-9BSy2E7BWY3t5Sm&index=5) + - [ ] [黑树(Black Tree)](https://en.wikipedia.org/wiki/Red%E2%80%93black_tree) + - [ ] [二分查找及红黑树的介绍](https://www.topcoder.com/community/data-science/data-science-tutorials/an-introduction-to-binary-search-and-red-black-trees/) -- ### N-ary (K-ary, M-ary) trees - - note: the N or K is the branching factor (max branches) - - binary trees are a 2-ary tree, with branching factor = 2 - - 2-3 trees are 3-ary - - [ ] [K-Ary Tree](https://en.wikipedia.org/wiki/K-ary_tree) +- ### N 叉树(K 叉树、M 叉树) + - 注意:N 或 K 指的是分支系数(即树的最大分支数): + - 二叉树是一种分支系数为2的树 + - 2-3树是一种分支系数为3的树 + - [ ] [K 叉树](https://en.wikipedia.org/wiki/K-ary_tree) ## Sorting @@ -848,7 +811,7 @@ You'll get more graph practice in Skiena's book (see Books section below) and th - how is tail recursion better than not? - [ ] [What Is Tail Recursion Why Is It So Bad?](https://www.quora.com/What-is-tail-recursion-Why-is-it-so-bad) - [ ] [Tail Recursion (video)](https://www.youtube.com/watch?v=L1jjXGfxozc) - + - ### Dynamic Programming - This subject can be pretty difficult, as each DP soluble problem must be defined as a recursion relation, and coming up with it can be tricky. - I suggest looking at many examples of DP problems until you have a solid understanding of the pattern involved. @@ -863,7 +826,7 @@ You'll get more graph practice in Skiena's book (see Books section below) and th - [ ] [Simonson: Dynamic programming II - Lecture 12 (video)](https://www.youtube.com/watch?v=v1qiRwuJU7g&list=PLFDnELG9dpVxQCxuD-9BSy2E7BWY3t5Sm&index=12) - [ ] List of individual DP problems (each is short): [Dynamic Programming (video)](https://www.youtube.com/playlist?list=PLrmLmBdmIlpsHaNTPP_jHHDx_os9ItYXr) - - [ ] Yale Lecture notes: + - [ ] Yale Lecture notes: - [ ] [Dynamic Programming](http://www.cs.yale.edu/homes/aspnes/classes/223/notes.html#dynamicProgramming) - [ ] Coursera: - [ ] [The RNA secondary structure problem (video)](https://www.coursera.org/learn/algorithmic-thinking-2/lecture/80RrW/the-rna-secondary-structure-problem) @@ -949,7 +912,7 @@ You'll get more graph practice in Skiena's book (see Books section below) and th - [ ] [Mutex in Python](https://www.youtube.com/watch?v=0zaPs8OtyKY) - Scalability and System Design are very large topics with many topics and resources, since there is a lot to consider + Scalability and System Design are very large topics with many topics and resources, since there is a lot to consider when designing a software/hardware system that can scale. Expect to spend quite a bit of time on this. - ### System Design, Scalability, Data Handling @@ -977,14 +940,14 @@ You'll get more graph practice in Skiena's book (see Books section below) and th - [ ] [How long does it take to make a context switch?](http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html) - [ ] [Transactions Across Datacenters (video)](https://www.youtube.com/watch?v=srOgpXECblk) - [ ] [A plain english introduction to CAP Theorem](http://ksat.me/a-plain-english-introduction-to-cap-theorem/) - - [ ] Paxos Consensus algorithm: + - [ ] Paxos Consensus algorithm: - [short video](https://www.youtube.com/watch?v=s8JqcZtvnsM) - [extended video with use case and multi-paxos](https://www.youtube.com/watch?v=JEpsBg0AO6o) - [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) - [ ] [Consistent Hashing](http://www.tom-e-white.com/2007/11/consistent-hashing.html) - [ ] [NoSQL Patterns](http://horicky.blogspot.com/2009/11/nosql-patterns.html) - [ ] [Optional: UML 2.0 Series (vido)](https://www.youtube.com/watch?v=OkC7HKtiZC0&list=PLGLfVvz_LVvQ5G-LdJ8RLqe-ndo7QITYc) - - [ ] OOSE: Software Dev Using UML and Java (21 videos): + - [ ] OOSE: Software Dev Using UML and Java (21 videos): - Can skip this if you have a great grasp of OO and OO design practices. - [OOSE: Software Dev Using UML and Java](https://www.youtube.com/playlist?list=PLJ9pm_Rc9HesnkwKlal_buSIHA-jTZMpO) - [ ] SOLID OOP Principles: @@ -997,7 +960,7 @@ You'll get more graph practice in Skiena's book (see Books section below) and th - [more flavor](http://docs.google.com/a/cleancoder.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BwhCYaYDn8EgN2M5MTkwM2EtNWFkZC00ZTI3LWFjZTUtNTFhZGZiYmUzODc1&hl=en) - [ ] L - [Liskov Substitution Principal](http://www.oodesign.com/liskov-s-substitution-principle.html) | [Base Class and Derived class follow ‘IS A’ principal](http://stackoverflow.com/questions/56860/what-is-the-liskov-substitution-principle) - [more flavor](http://docs.google.com/a/cleancoder.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BwhCYaYDn8EgNzAzZjA5ZmItNjU3NS00MzQ5LTkwYjMtMDJhNDU5ZTM0MTlh&hl=en) - - [ ] I - [Interface segregation principle](http://www.oodesign.com/interface-segregation-principle.html) | clients should not be forced to implement interfaces they don't use + - [ ] I - [Interface segregation principle](http://www.oodesign.com/interface-segregation-principle.html) | clients should not be forced to implement interfaces they don't use - [Interface Segregation Principle in 5 minutes (video)](https://www.youtube.com/watch?v=3CtAfl7aXAQ) - [more flavor](http://docs.google.com/a/cleancoder.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BwhCYaYDn8EgOTViYjJhYzMtMzYxMC00MzFjLWJjMzYtOGJiMDc5N2JkYmJi&hl=en) - [ ] D -[Dependency Inversion principle](http://www.oodesign.com/dependency-inversion-principle.html) | Reduce the dependency In composition of objects. @@ -1005,7 +968,7 @@ You'll get more graph practice in Skiena's book (see Books section below) and th - [more flavor](http://docs.google.com/a/cleancoder.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BwhCYaYDn8EgMjdlMWIzNGUtZTQ0NC00ZjQ5LTkwYzQtZjRhMDRlNTQ3ZGMz&hl=en) - [ ] Scalability: - [ ] [Great overview (video)](https://www.youtube.com/watch?v=-W9F__D3oY4) - - [ ] Short series: + - [ ] Short series: - [Clones](http://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones) - [Database](http://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database) - [Cache](http://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache) @@ -1164,7 +1127,7 @@ You'll get more graph practice in Skiena's book (see Books section below) and th --- -## Final Review +## Final Review This section will have shorter videos that can you watch pretty quickly to review most of the important concepts. It's nice if you want a refresher often. @@ -1180,7 +1143,7 @@ You'll get more graph practice in Skiena's book (see Books section below) and th #### Sorts: - [ ] Merge Sort: https://www.youtube.com/watch?v=GCae1WNvnZM - + ## Books @@ -1207,7 +1170,7 @@ You'll get more graph practice in Skiena's book (see Books section below) and th - [ ] [Cracking the Coding Interview, 6th Edition](http://www.amazon.com/Cracking-Coding-Interview-6th-Programming/dp/0984782850/) - If you see people reference "The Google Resume", it was a book replaced by "Cracking the Coding Interview". -### Additional books +### Additional books These were not suggested by Google but I added because I needed the background knowledge @@ -1226,7 +1189,7 @@ You'll get more graph practice in Skiena's book (see Books section below) and th - [ ] [Introduction to Algorithms](https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844) - Half.com is a great resource for textbooks at good prices. - + - [ ] [Elements of Programming Interviews](https://www.amazon.com/Elements-Programming-Interviews-Insiders-Guide/dp/1479274836) - all code is in C++, if you're looking to use C++ in your interview - good book on problem solving in general. @@ -1279,7 +1242,7 @@ Programming: Think of about 20 interview questions you'll get, along the lines of the items below. Have 2-3 answers for each Have a story, not just data, about something you accomplished - + - Why do you want this job? - What's a tough problem you've solved? - Biggest challenges faced? @@ -1321,9 +1284,9 @@ You're never really done. ***************************************************************************************************** ***************************************************************************************************** - - Everything below this point is optional. These are my recommendations, not Google's. - By studying these, you'll get greater exposure to more CS concepts, and will be better prepared for + + Everything below this point is optional. These are my recommendations, not Google's. + By studying these, you'll get greater exposure to more CS concepts, and will be better prepared for any software engineering job. ***************************************************************************************************** @@ -1385,7 +1348,7 @@ You're never really done. - [ ] [Core Markov Text Generation](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/waxgx/core-markov-text-generation) - [ ] [Core Implementing Markov Text Generation](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/gZhiC/core-implementing-markov-text-generation) - [ ] [Project = Markov Text Generation Walk Through](https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/EUjrq/project-markov-text-generation-walk-through) - - See more in MIT 6.050J Information and Entropy series below. + - See more in MIT 6.050J Information and Entropy series below. - ### Parity & Hamming Code (videos) - [ ] [Intro](https://www.youtube.com/watch?v=q-3BctoUpHE) @@ -1409,7 +1372,7 @@ You're never really done. - ### Compression - make sure to watch information theory videos first - - [ ] Computerphile (videos): + - [ ] Computerphile (videos): - [ ] [Compression](https://www.youtube.com/watch?v=Lto-ajuqW3w) - [ ] [Entropy in Compression](https://www.youtube.com/watch?v=M5c_RFKVkko) - [ ] [Upside Down Trees (Huffman Trees)](https://www.youtube.com/watch?v=umTbivyJoiI) @@ -1551,13 +1514,13 @@ You're never really done. - ### Math for Fast Processing - [ ] [Integer Arithmetic, Karatsuba Multiplication (video)](https://www.youtube.com/watch?v=eCaXlAaN2uE&index=11&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb) - [ ] [The Chinese Remainder Theorem (used in cryptography) (video)](https://www.youtube.com/watch?v=ru7mWZJlRQg) - + - ### Treap - Combination of a binary search tree and a heap - [ ] [Treap](https://en.wikipedia.org/wiki/Treap) - [ ] [Data Structures: Treaps explained (video)](https://www.youtube.com/watch?v=6podLUYinH8) - [ ] [Applications in set operations](https://www.cs.cmu.edu/~scandal/papers/treaps-spaa98.pdf) - + - ### Linear Programming (videos) - [ ] [Linear Programming](https://www.youtube.com/watch?v=M4K6HYLHREQ) - [ ] [Finding minimum cost](https://www.youtube.com/watch?v=2ACJ9ewUC6U) @@ -1661,7 +1624,7 @@ Sit back and enjoy. "netflix and skill" :P - [ ] [UC Berkeley 61B (Fall 2006): Data Structures (39 videos)]( https://www.youtube.com/playlist?list=PL4BBB74C7D2A1049C) - [ ] [UC Berkeley 61C: Machine Structures (26 videos)](https://www.youtube.com/watch?v=gJJeUFyuvvg&list=PL-XXv-cvA_iCl2-D-FS5mk0jFF6cYSJs_) - + - [ ] [OOSE: Software Dev Using UML and Java (21 videos)](https://www.youtube.com/playlist?list=PLJ9pm_Rc9HesnkwKlal_buSIHA-jTZMpO) - [ ] [UC Berkeley CS 152: Computer Architecture and Engineering (20 videos)](https://www.youtube.com/watch?v=UH0QYvtP7Rk&index=20&list=PLkFD6_40KJIwEiwQx1dACXwh-2Fuo32qr) @@ -1693,11 +1656,10 @@ Sit back and enjoy. "netflix and skill" :P - [ ] [Introduction to Cryptography](https://www.youtube.com/watch?v=2aHkqB2-46k&feature=youtu.be) - [more in series (not in order)](https://www.youtube.com/channel/UC1usFRN4LCMcfIV7UjHNuQg) - + - [ ] [Mining Massive Datasets - Stanford University (94 videos)](https://www.youtube.com/playlist?list=PLLssT5z_DsK9JDLcT8T62VtzwyW9LNepV) ## Computer Science Courses - [Directory of Online CS Courses](https://github.com/open-source-society/computer-science) - [Directory of CS Courses (many with online lectures)](https://github.com/prakhar1989/awesome-courses) -