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
  • 相关阅读:
    timeouts _ golang
    select.go
    channel directions _ golang
    channel synchronization _ golang
    channel _ buffering
    servlet:共享资源造成的线程冲突
    java:多线程的 共享资源冲突问题
    jsp:通过过滤器进行网页的资源管理
    jsp:通过Session控制登陆时间和内部页面的访问
    java:数据结构
  • 原文地址:https://www.cnblogs.com/graphics/p/1498122.html
Copyright © 2011-2022 走看看