上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 44 下一页
摘要: You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take tu 阅读全文
posted @ 2016-02-29 01:19 Grandyang 阅读(12067) 评论(7) 推荐(1) 编辑
摘要: You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take tu 阅读全文
posted @ 2016-02-28 15:51 Grandyang 阅读(10421) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if a permutation of the string could form a palindrome. Example 1: Example 2: Example 3: Hint: 这道题让我们判断一个字符串的全排列有没有是回文字符串的,那 阅读全文
posted @ 2016-02-27 17:29 Grandyang 阅读(10488) 评论(3) 推荐(0) 编辑
摘要: An abbreviation of a word follows the form <first letter><number><last letter>. Below are some examples of word abbreviations: a) it --> it (no abbrev 阅读全文
posted @ 2016-02-26 15:33 Grandyang 阅读(10797) 评论(0) 推荐(0) 编辑
摘要: You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres 阅读全文
posted @ 2016-02-25 14:17 Grandyang 阅读(8989) 评论(14) 推荐(1) 编辑
摘要: Given two 1d vectors, implement an iterator to return their elements alternately. Example: Follow up: What if you are given k 1d vectors? How well can 阅读全文
posted @ 2016-02-24 14:13 Grandyang 阅读(10782) 评论(4) 推荐(0) 编辑
摘要: Implement an iterator to flatten a 2d vector. For example,Given 2d vector = [ [1,2], [3], [4,5,6] ] By calling next repeatedly until hasNext returns f 阅读全文
posted @ 2016-02-23 13:37 Grandyang 阅读(13200) 评论(3) 推荐(0) 编辑
摘要: Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. Example : Input: 阅读全文
posted @ 2016-02-22 13:34 Grandyang 阅读(14068) 评论(4) 推荐(1) 编辑
摘要: Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequen 阅读全文
posted @ 2016-02-21 12:51 Grandyang 阅读(14547) 评论(2) 推荐(0) 编辑
摘要: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to count the total strobog 阅读全文
posted @ 2016-02-20 14:28 Grandyang 阅读(11881) 评论(4) 推荐(0) 编辑
摘要: When you use FLTK with VS2010, you may get the error: fatal error C1083: Cannot open include file: 'X11/Xlocale.h': No such file or directory. The way 阅读全文
posted @ 2016-02-20 04:29 Grandyang 阅读(2001) 评论(0) 推荐(0) 编辑
摘要: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Find all strobogrammatic numbers that are o 阅读全文
posted @ 2016-02-19 14:29 Grandyang 阅读(14543) 评论(3) 推荐(0) 编辑
摘要: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to determine if a number i 阅读全文
posted @ 2016-02-18 00:54 Grandyang 阅读(10945) 评论(2) 推荐(0) 编辑
摘要: Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Your algorithm 阅读全文
posted @ 2016-02-17 10:45 Grandyang 阅读(17798) 评论(3) 推荐(1) 编辑
摘要: Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. word1 and word2 may be the same 阅读全文
posted @ 2016-02-16 13:15 Grandyang 阅读(10575) 评论(0) 推荐(0) 编辑
摘要: A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand operation which turns the water at position (row, col) 阅读全文
posted @ 2016-02-15 14:12 Grandyang 阅读(29453) 评论(15) 推荐(0) 编辑
摘要: Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), where largest means subtree with largest number of nodes in it. Not 阅读全文
posted @ 2016-02-14 13:01 Grandyang 阅读(18357) 评论(15) 推荐(0) 编辑
摘要: Design a class which receives a list of words in the constructor, and implements a method that takes two words word1 and word2 and return the shortest 阅读全文
posted @ 2016-02-13 14:57 Grandyang 阅读(13012) 评论(2) 推荐(1) 编辑
摘要: Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. Example:Assume that words = ["p 阅读全文
posted @ 2016-02-12 14:55 Grandyang 阅读(16378) 评论(6) 推荐(1) 编辑
摘要: The 14 best data visualization tools The 38 best tools for data visualization 阅读全文
posted @ 2016-02-12 06:12 Grandyang 阅读(1161) 评论(0) 推荐(0) 编辑
摘要: Given an input string , reverse the string word by word. Example: Input: ["t","h","e"," ","s","k","y"," ","i","s"," ","b","l","u","e"] Output: [& 阅读全文
posted @ 2016-02-11 07:48 Grandyang 阅读(13371) 评论(3) 推荐(0) 编辑
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function 阅读全文
posted @ 2016-02-10 00:33 Grandyang 阅读(19053) 评论(6) 推荐(0) 编辑
摘要: Given a string s , find the length of the longest substring t that contains at most 2 distinct characters. Example 1: Input: "eceba" Output: 3 Explana 阅读全文
posted @ 2016-02-09 15:20 Grandyang 阅读(20655) 评论(5) 推荐(1) 编辑
摘要: Given a sorted integer array nums, where the range of elements are in the inclusive range [lower, upper], return its missing ranges. Example: Input: n 阅读全文
posted @ 2016-02-08 07:21 Grandyang 阅读(16258) 评论(3) 推荐(2) 编辑
摘要: Given two strings s and t, determine if they are both one edit distance apart. Note: There are 3 possiblities to satisify one edit distance apart: Exa 阅读全文
posted @ 2016-02-07 14:34 Grandyang 阅读(17016) 评论(6) 推荐(0) 编辑
摘要: Design and implement a TwoSum class. It should support the following operations: add and find. add - Add the number to an internal data structure.find 阅读全文
posted @ 2016-02-06 15:46 Grandyang 阅读(16025) 评论(6) 推荐(0) 编辑
摘要: Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tick 阅读全文
posted @ 2016-02-05 15:22 Grandyang 阅读(21105) 评论(11) 推荐(0) 编辑
摘要: Given a file and assume that you can only read the file using a given method read4, implement a method read to read n characters. Your method read may 阅读全文
posted @ 2016-02-04 15:09 Grandyang 阅读(16715) 评论(10) 推荐(0) 编辑
摘要: MATLAB 矩阵实验室 7.0.1 Simulink 仿真 6.1 Aerospace Blockset 太空模块 1.6.1 Bioinformatics Toolbox 生物信息工具箱 1.1.1 CDMA Reference Blockset 码分多址参数模块 1.1 Communicati 阅读全文
posted @ 2016-02-03 07:30 Grandyang 阅读(4389) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... Example: Input: nums = [3,5,2,1,6,4] Output: 阅读全文
posted @ 2016-02-02 13:22 Grandyang 阅读(21887) 评论(0) 推荐(0) 编辑
摘要: One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, 阅读全文
posted @ 2016-02-01 10:52 Grandyang 阅读(11395) 评论(5) 推荐(0) 编辑
摘要: Given a file and assume that you can only read the file using a given method read4, implement a method to read n characters. Method read4: The API rea 阅读全文
posted @ 2016-02-01 02:54 Grandyang 阅读(18070) 评论(2) 推荐(0) 编辑
摘要: Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up 阅读全文
posted @ 2016-01-31 08:59 Grandyang 阅读(15624) 评论(3) 推荐(1) 编辑
摘要: VS2010 NVIDIA OpenCL 开发环境配置 CUDA 在线课程 [经典培训] 全球首套中文CUDA 教程-胡文美教授主讲 阅读全文
posted @ 2016-01-29 02:11 Grandyang 阅读(1089) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to find the number of connected 阅读全文
posted @ 2016-01-28 15:14 Grandyang 阅读(17207) 评论(2) 推荐(0) 编辑
摘要: Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be for 阅读全文
posted @ 2016-01-28 12:42 Grandyang 阅读(10968) 评论(11) 推荐(1) 编辑
摘要: Chapter 1. Arrays and Strings 1.1 Unique Characters of a String 1.2 Reverse String 1.3 Permutation String 1.4 Replace Spaces 1.5 Compress String 1.6 R 阅读全文
posted @ 2016-01-27 13:44 Grandyang 阅读(8945) 评论(2) 推荐(0) 编辑
摘要: Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Range sum S(i, j) is defined as the sum of the eleme 阅读全文
posted @ 2016-01-27 11:33 Grandyang 阅读(18286) 评论(6) 推荐(0) 编辑
摘要: 在MatLab做的GUI界面,我们有时候会希望界面的大小能改变,并且上面的控件也会跟着界面变大或者缩小,MatLab在这方面做的非常好,不像Qt的GUI那样实现起来那么麻烦,只需要把界面的属性Resize改成ON,把各个控件的Unit属性改成Normalized即可。 阅读全文
posted @ 2016-01-23 09:34 Grandyang 阅读(5694) 评论(0) 推荐(0) 编辑
摘要: 在MatLab的GUI界面编程,我们在调试的时候需要打印出一些变量,那么介绍下我用到的两种调试方法:第一种,使用弹出对话框来打印变量,要注意的是打印的东西必须是string类型的,所以其他类型的变量需要转换成string类型的,比如用num2str()函数将数字转为字符串显示出来。我们还可以用cla... 阅读全文
posted @ 2016-01-22 13:33 Grandyang 阅读(2408) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 44 下一页
Fork me on GitHub