zoukankan      html  css  js  c++  java
  • Shortest distance between two arrays

    Given two sorted array in non-descending order, each contains positive integers
    The distance is define as following
    pick up a number from each array, compute their difference
    return the shortest distance among them-that's the distance between the two arrays
    example
    int[] a = {1, 3, 5, 7 , 9} ;
    int[] b = {2, 4, 8} ;
    The result is 1

    Code
  • 相关阅读:
    CUDA编程学习(一)
    数据挖掘领域的十大经典算法
    MATLAB代码加密生成.p文件
    如何读入文件下的图像序列
    什么是co-training
    Addthis使用
    html5新增及删除标签
    html5语法
    设置SecureCRT配色和解决乱码问题
    html5新增及废除属性
  • 原文地址:https://www.cnblogs.com/graphics/p/1498122.html
Copyright © 2011-2022 走看看