10 2016 档案
摘要:
阅读全文
摘要:根据类别建立文件夹,并把js文件放在相应的文件夹下面: 静态的html文件里面很多重复的部分 在这个两个html文件里面,only unique的部分就是特定的一些div 把unique的部分放在own temple file里面 把templates 放在自己的文件夹里面: 把ng-app加载 m
阅读全文
摘要:1. 并查集相关的题目 2. Surrounded Regions Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all
阅读全文
摘要:1. union find 并查集 一种用来解决集合查询和合并的数据结构 并查集能够干什么? 1. find 操作 判断在不在同一个集合中 2. union关于集合合并 例子: A, B, C的boss 是B D,E,F的boss是E 那么组成了两个集合。 每个节点都包含了一个指针,指向其boss,
阅读全文
摘要:写在前面: 解释一道算法题步骤 1. Document your assumptioms 2. Explain you approach and how you intend to slove the problem 3. Provide code comments where applicable
阅读全文
摘要:目录: 1. 前言 碰到二叉树的问题,就想想整棵树在该问题上的结果和左右子树在该问题上的结果之间的联系是什么! 举个🌰 : Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum d
阅读全文
摘要:9. 比较两棵二叉树是否相等 递归: 左右子树是否相等 用上面这种方法的话,递归的判断高度是否相等,会造成 非递归:利用前序遍历,遍历整棵树,一一比较 -------------------------------------------------------------------------
阅读全文
摘要:1 Search in Rotated Sorted Array 二分搜索,注意分清各种情况 1 public class Solution { 2 public int search(int[] nums, int target) { 3 int i = 0, j = nums.length -
阅读全文
摘要:在计算机科学中,排序是一门基础的算法技术,许多算法都要以此作为基础,不同的排序算法有着不同的时间开销和空间开销。排序算法有非常多种,如我们最常用的快速排序和堆排序等算法,这些算法需要对序列中的数据进行比较,因为被称为基于比较的排序。 基于比较的排序算法是不能突破O(NlogN)的。简单证明如下: N
阅读全文
摘要:目录: 1. javascript part1 2. Angular js part1 part2 part3 //to do 3. bootstrap part1 part2 part3
阅读全文
摘要:1. 选择排序 selection sort 大循环 从左到右每次以一个点开始扫描array 小循环 找到从当前起始点开始的最小值 时间复杂度为O(N^2) //selection sort an array array[] public class Solution { public int[]
阅读全文
摘要:回溯算法 题目整理 part1 回溯算法 题目整理 part2 1、概念 回溯算法实际上一个类似枚举的搜索尝试过程,主要是在搜索尝试过程中寻找问题的解,当发现已不满足求解条件时,就“回溯”返回,尝试别的路径。 回溯法是一种选优搜索法,按选优条件向前搜索,以达到目标。但当探索到某一步时,发现原先选择并
阅读全文
摘要:动态规划的实质: 根据小问题的结果来判断大问题的结果 记忆化搜索 避免中间重复的计算结果 什么时候使用动态规划: 求最大最小值 判断是否可行 统计方案个数 什么时候不用动态规划: 求出所有具体的方案而非方案个数 输入数据是一个集合而不是序列 暴力算法的复杂度已经是多项式级别 动态规划4要素 面试中动
阅读全文
摘要:Reorder List Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes
阅读全文
摘要:将小数组归并到大数组里 Merge Sorted Array Given two sorted integer arrays A and B, merge B into A as one sorted array. Example Given two sorted integer arrays A
阅读全文
摘要:1 Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able
阅读全文
摘要:Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. Examples: Given
阅读全文
摘要:level3 Typography: How can we use bootstraps to make our lead text stand out more? .lead class centering text: using the .text-* in bootstrap front we
阅读全文
摘要:level2 responsive design rows: columns: we can use multiple columns: we can use .col-md-* we can do something like this Adding row, make code easier t
阅读全文
摘要:level 1 framework defination: bootstrap file structure: Adding bootstrp to our html: bootstrap relays on jquery, so we also need to add jquery inside
阅读全文
摘要:基础1: partition Partition Array Given an array nums of integers and an int k, partition the array (i.e move the elements in "nums") such that: All elem
阅读全文
摘要:N-Queens 模拟退火不会写 0.0 The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an i
阅读全文
摘要:First Missing Positive Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] ret
阅读全文
摘要:level4 当我们需要打印多次product name 和product price的时候,我们要重复利用这2行代码 如果要传入string,那么用“” 里面包含‘’。利用ng-include 加载页面以后,用ajax call来拿到需要include的page 分割线 a better way
阅读全文
摘要:回溯法概念:回溯算法实际上一个类似枚举的搜索尝试过程,主要是在搜索尝试过程中寻找问题的解,当发现已不满足求解条件时,就“回溯”返回,尝试别的路径。 回溯法是一个既带有系统性又带有跳跃性的的搜索算法。它在包含问题的所有解的解空间树中,按照深度优先的策略,从根结点 出发搜索解空间树。算法搜索至解空间树的
阅读全文
摘要:level 3 Forms and Models 如何添加和显示review? review内容作为product的内容的一部分!放在app.js文件里面 在html显示页面里面,增加一个循环来显示review的内容 我们如何把表单要填写的内容和我们要显示的内容进行绑定呢? 通过ng-model d
阅读全文
摘要:javascript 1. 转义字符 \\ 打印出来是\ \n 打印出来是回车 2. 比较string时候可以用 == 不像java比较的是2个指针了 哈哈 "A" == "B" 3. 变量定义及赋值 //to do -----------------------------------------
阅读全文
摘要:1. min/max heap 看到K神马的基本上就是min/max heap. (1) Find the K closest points to the origin in a 2D plane, given an array containing N points. 1 public stati
阅读全文
浙公网安备 33010602011771号