码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
Add Binary
https://leetcode.com/problems/add-binary/#/description 思路是把问题泛化成一个二进制carry 上浮的操作。比如从最低位开始,设置一个进位值,比如3,然后按照二进制的法则对这个carry 进行进位操作,既从低位到高位依次上浮,直到carry 为0 ...
分类:其他好文   时间:2017-06-01 18:35:25    阅读次数:131
二分查找法
// 二分查找法,在有序数组arr中,查找target// 如果找到target,返回相应的索引index// 如果没有找到target,返回-1template<typename T>int binarySearch(T arr[], int n, T target){ // 在arr[l...r ...
分类:其他好文   时间:2017-06-01 13:23:30    阅读次数:158
学习分享
之前使用SQL把十进制的整数转换为三十六进制,SQL代码请参考:SQL Server 进制转换函数,其实它是基于二、八、十、十六进制转换的计算公式的,进制之间的转换是很基础的知识,但是我发现网络上没有一篇能把它说的清晰、简单、易懂的文章,所以我才写这篇文章的念头,希望能让你再也不用担心、害怕进制之间 ...
分类:其他好文   时间:2017-05-31 23:09:08    阅读次数:261
LeetCode Maximal Square
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 matr ...
分类:其他好文   时间:2017-05-31 22:17:52    阅读次数:264
哈希(3) - 推断一个数组是否为还有一个数组的子集
给定两个数组:arr1[0..m-1]和arr2[0..n-1]. 推断arr2[]是否为arr1[]的子集。这两个数组都是无序的。 比如: 输入: arr1[] = {11, 1, 13, 21, 3, 7}, arr2[] = {11, 3, 7, 1} 输出: arr2是arr1的子集。 输入 ...
分类:编程语言   时间:2017-05-31 19:09:24    阅读次数:276
第十二章 Shell脚本编写及常见面试题(三)
本章目录:12.21FTP下载文件#!/bin/bash if[$#-ne1];then echo"Usage:$0filename" fi dir=$(dirname$1) file=$(basename$1) ftp-n-v<<EOF#-n自动登录 open192.168.1.10 useradminadminpass binary#设置ftp传输模式为二进制,避免MD5值不同或.tar.gz压缩包格式错误 cd$dir..
分类:系统相关   时间:2017-05-31 15:27:51    阅读次数:387
gensim加载word2vec训练结果(bin文件)并进行相似度实验
# -*- coding: utf-8 -*- import gensim # 导入模型 model = gensim.models.KeyedVectors.load_word2vec_format('vectors.bin', binary=True) # 得到两组词的相似度 list1 = [... ...
分类:其他好文   时间:2017-05-31 12:10:24    阅读次数:798
Binary Tree Paths
/** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val... ...
分类:其他好文   时间:2017-05-31 10:29:40    阅读次数:169
Minimum Depth of Binary Tree
This question is a little bit harder than the Max Depth. We only compare the depth of the leaf node. If it is missing one side, this level shouldn't b ...
分类:其他好文   时间:2017-05-31 10:14:30    阅读次数:254
Balanced Binary Tree
Note:a balaced tree needs to be balaced all the time. So it is important remember the status of each subtree. If it is not balaced in the middle, the ...
分类:其他好文   时间:2017-05-31 10:14:05    阅读次数:151
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!