上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: 本文记录一下,个人在2015年夏季申请各个公司碰到的面试题。仅供学习和参考。【JAVA】1. LinkedList和ArrayList的区别。答:1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构;2.对于随机访问get和set,ArrayList觉得优于L... 阅读全文
posted @ 2015-07-19 12:16 Chapter 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 问题描述Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumb... 阅读全文
posted @ 2015-07-19 10:50 Chapter 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 问题描述Given preorder and inorder traversal of a tree, construct the binary tree.解决思路首先确定根节点,然后确定左右子树的节点数目。依次递归即可。假设输入的序列均合法。程序public class BuildTreeFrom... 阅读全文
posted @ 2015-07-18 11:04 Chapter 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 问题描述Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the ... 阅读全文
posted @ 2015-07-17 18:34 Chapter 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 问题描述Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next po... 阅读全文
posted @ 2015-07-17 17:53 Chapter 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 问题描述Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.解决思路递归思路。中序遍历的过程中,第一个违反顺序的节点一定是错... 阅读全文
posted @ 2015-07-17 12:08 Chapter 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 问题描述给定一棵BST和一个数K,找出BST中与K值最为接近的数。解决思路递归。返回当前节点和目标值的差值、左子树节点和目标值的差值以及右子树节点和目标值的差值中,最小的那个所对应节点值。程序public class FindClosestInBST { public TreeNode findCl... 阅读全文
posted @ 2015-07-17 11:34 Chapter 阅读(614) 评论(0) 推荐(0) 编辑
摘要: 问题描述Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums exc... 阅读全文
posted @ 2015-07-16 10:30 Chapter 阅读(715) 评论(0) 推荐(0) 编辑
摘要: 问题描述Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus +... 阅读全文
posted @ 2015-07-15 12:26 Chapter 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 问题描述Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following ... 阅读全文
posted @ 2015-07-15 10:40 Chapter 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页