上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页
摘要: In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data.You're given a matrix represented by a two-dimensi... 阅读全文
posted @ 2017-09-10 18:40 稀里糊涂林老冷 阅读(297) 评论(0) 推荐(0)
摘要: You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums2.Th... 阅读全文
posted @ 2017-09-10 18:25 稀里糊涂林老冷 阅读(213) 评论(0) 推荐(0)
摘要: Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below.American keyboardExample 1:Input: ["Hello", "Alaska", "D... 阅读全文
posted @ 2017-09-10 18:14 稀里糊涂林老冷 阅读(226) 评论(0) 推荐(0)
摘要: You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely ... 阅读全文
posted @ 2017-09-10 18:09 稀里糊涂林老冷 阅读(310) 评论(0) 推荐(0)
摘要: Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to distribute these... 阅读全文
posted @ 2017-09-10 18:04 稀里糊涂林老冷 阅读(251) 评论(0) 推荐(0)
摘要: leetcode算法: Find Bottom Left Tree ValueGiven a binary tree, find the leftmost value in the last row of the tree.Example 1:Input: 2 / \ 1 3Output:1Example 2: Input: 1 / \ 2 ... 阅读全文
posted @ 2017-09-10 17:32 稀里糊涂林老冷 阅读(285) 评论(0) 推荐(0)
摘要: 1 /* 2 1 简单单体 3 */ 4 var Singleton = { 5 attr1: 1 , 6 method1:function(){ 7 //do sth 8 } 9 }; 10 alert(Singleton.attr1); 11 Singleton.method1(); 12 13... 阅读全文
posted @ 2017-08-30 22:02 稀里糊涂林老冷 阅读(281) 评论(0) 推荐(0)
摘要: 1 /* 2 接口:提供一种说明一个对象应该有哪些方法的手段 3 js中有三种方式实现接口: 4 1 注释描述接口 5 2 属性检测接口 6 3 鸭式辨型接口 7 */ 8 9 /* 10 1 注释描述接口: 不推荐 11 优点: 利用注解,给出参考 12 缺点:纯文档约束,是一个假接口, 13... 阅读全文
posted @ 2017-08-30 22:01 稀里糊涂林老冷 阅读(5497) 评论(0) 推荐(0)
摘要: javascript中实现继承的三种方式:原型继承、借用构造函数继承、混合继承: 但是 上面三种方式 即使是混合继承也有弊端,下面用js模拟一下extends的继承方,来实现不会重复继承父类的构造函数: 阅读全文
posted @ 2017-08-29 09:47 稀里糊涂林老冷 阅读(753) 评论(0) 推荐(0)
摘要: 1 //简单重写原型对象: 2 3 //一个构造函数Person 4 function Person(){ 5 6 } 7 //重写Person的原型 8 //把Person的原型赋值给一个新的对象 是我们重写的过程 9 Person.prototype={ 10 // 对于构造器 如果我们不给他写,则构造器就是Object的构造器了 11 constr... 阅读全文
posted @ 2017-08-27 11:51 稀里糊涂林老冷 阅读(812) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页