数据结构
为不为
这个作者很懒,什么都没留下…
展开
-
java 树的应用
package Tree; /** * Created by gmy on 2017/6/19. */ public class Solution { public TreeNode addOneRow(TreeNode t,int v,int d){ if(d==1){ TreeNode n=new TreeNode(v);原创 2017-06-19 11:26:09 · 654 阅读 · 0 评论 -
谷歌面试题(5)
原题:// You are given a m x n 2D grid initialized with these three possible values.// -1 - A wall or an obstacle. // 0 - A gate. // INF - Infinity means an empty room. We use the value 231 - 1 = 21474836原创 2017-10-16 14:42:51 · 371 阅读 · 0 评论 -
谷歌面试题(一)
原题:// Given two 1d vectors, implement an iterator to return their elements alternately.// For example, given two 1d vectors:// v1 = [1, 2] // v2 = [3, 4, 5, 6] // By calling next repeatedly until hasNe原创 2017-10-16 14:38:57 · 231 阅读 · 0 评论 -
谷歌面试题(9)
大家都知道谷歌是科技界的领头羊,他的面试题肯定有一些参考意义,所以本人就选了几道代表性面试题。给自己或其他人一些帮助原题:// Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap a原创 2017-10-16 14:47:05 · 227 阅读 · 0 评论 -
谷歌面试题(8)
大家都知道谷歌是科技界的领头羊,他的面试题肯定有一些参考意义,所以本人就选了几道代表性面试题。给自己或其他人一些帮助原题:// An abbreviation of a word follows the form <first letter><number><last letter>. Below are some examples of word abbreviations:// a) it原创 2017-10-16 14:46:24 · 568 阅读 · 0 评论 -
谷歌面试题(7)
原题:// A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:// For 1-byte character, the first bit is a 0, followed by its unicode code. // For n-bytes character, the firs原创 2017-10-16 14:44:20 · 455 阅读 · 0 评论 -
谷歌面试题(6)
原题:// Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.// The brackets must close in the correct order, "()" and "()[]{}" are all va原创 2017-10-16 14:43:35 · 318 阅读 · 0 评论