关闭
当前搜索:

Binary Tree Preorder Traversal python

二叉树的前序遍历(非递归)(小米云计算一面)java/** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = v......
阅读(11) 评论(0)

Copy Books

Given n books and the ith book has A[i] pages. You are given k people to copy the n books.n books list in a row and each person can claim a continous range of the n books. For example one copier can c......
阅读(34) 评论(0)

经典二分法

Find any position of a target number in a sorted array. Return -1 if target does not exist.java实现public class Solution { /* * @param nums: An integer array sorted in ascending order * @p......
阅读(18) 评论(0)

滴滴大数据面经

地点:西二旗文思海辉2月11日面试完百度之后,看到手机的未接电话,感觉应该是面试邀约,但是没有接到,打回去后对方又一直不接,于是秉承着不要脸的精神一直打了5个电话,对方终于接通。接通后简单的谈了一些项目中的问题,又问了问所学的课程,可能是点面试听到了地铁站的声音,面试官就没有在继续问下去,说可以约一个面试的时间,当时脑子起泡,直接说可以明天(腊月27面试),面试官说:“好!”。说完后,我就感觉我是......
阅读(53) 评论(0)

linux面试常用命令

完整链接:http://linux.chinaitlab.com/special/linuxcom/Index.html显示目录和文件的命令   Ls:用于查看所有文件夹的命令。   Dir:用于显示指定文件夹和目录的命令   Tree: 以树状图列出目录内容   Du:显示目录或文件大小  修改目录,文件权限和属主及数组命令   Chmod:用于改变指定文件的权限命令。   Chown:用于改变......
阅读(23) 评论(0)

百度抽样算法面试题(部分)

1.  给你一个长度为N的链表。N很大,但你不知道N有多大。你的任务是从这N个元素中随机取出k个元素。你只能遍历这个链表一次。你的算法必须保证取出的元素恰好有k个,且它们是完全随机的(出现概率均等)。解:先选中前k个, 从第k+1个元素到最后一个元素为止, 以k/i (i=k+1, k+2,...,N) 的概率选中第i个元素,并且随机替换掉一个原先选中的元素, 这样遍历一次得到k个元素, 可以保证......
阅读(30) 评论(0)

主机和docker之间互传文件

主机和容器之间传输文件的话需要用到容器的ID全称。 获取方法如下: 1.先拿到容器的短ID或者指定的name。 2.然后根据这两项的任意一项拿到ID全称。 有了这个长长的ID的话,本机和容器之间的文件传输就简单了。 docker cp 本地文件路径 ID全称:容器路径1 进入容器之后就能够看到刚才上传进来的文件了。 如果是容器传...
阅读(60) 评论(0)

strStr II

Implement strStr function in O(n + m) time. strStr return the first index of the target string in a source string. The length of the target string is m and the length of the source string is n. If...
阅读(60) 评论(0)

Expression Expand

Given an expression s includes numbers, letters and brackets. Number represents the number of repetitions inside the brackets(can be a string or another expression).Please expand expression to be a ...
阅读(100) 评论(0)

Flatten Nested List Iterator

Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be integers or other lists.  Notice You don't nee...
阅读(72) 评论(0)

Zigzag Iterator

Given two 1d vectors, implement an iterator to return their elements alternately. Have you met this question in a real interview?  Yes Example Given two 1d vectors: v1 = [1, 2] v2...
阅读(54) 评论(0)

High Five

There are two properties in the node student id and scores, to ensure that each student will have at least 5 points, find the average of 5 highest scores for each person. Have you met this ques...
阅读(72) 评论(0)

Top k Largest Numbers II

Implement a data structure, provide two interfaces: add(number). Add a new number in the data structure.topk(). Return the top k largest numbers in this data structure. k is given when we create ...
阅读(77) 评论(0)

Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Have you met this question in a real interview?  Yes Example Given lists: [ 2...
阅读(95) 评论(0)

Triangle Count

Given an array of integers, how many three numbers can be found in the array, so that we can build an triangle whose three edges length is the three numbers that we find?  Have you met this quest...
阅读(68) 评论(0)
647条 共44页1 2 3 4 5 ... 下一页 尾页
    个人资料
    • 访问:197614次
    • 积分:7981
    • 等级:
    • 排名:第3115名
    • 原创:605篇
    • 转载:37篇
    • 译文:5篇
    • 评论:56条
    最新评论