由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - interview question
相关主题
Simple question: delete element from collection on condition?Re: hashtable
How to check if an element is in an array? ObjectOutputStream.writeObject(Hashtable) ?
问一道关于Vector的题请教一个多线程lock机制的问题
问个数组问题传递一个object reference,如何防止更改object?
Java里有没有象cell array一样的东西哪位大牛帮帮忙, 初学JAVA, 问题一道
Collection return type and web service让大家了解工业界Java/J2EE面试题的难度
HashMap 怎样循环用更快?问HashSet的问题?
Java 问题,请教如何找出一个array里的duplicate segments? (转载)学以致用,但多此一举?
相关话题的讨论汇总
话题: question话题: hashmap话题: arrays话题: interview话题: elements
进入Java版参与讨论
1 (共1页)
m*****a
发帖数: 5
1
there are 2 integer arrays a and b ;
how do find the intersection of these two arrays and keep the order of array
a?
Has any one posted this question before?
s***y
发帖数: 124
2
Build a HashMap using b,
Loop through a, check if element is in the HashMap
m*****a
发帖数: 5
3
Thanks. then how do you handle the repeat of elements?
say; A { 1,5, 5, 8 , 7,6,5}
B: {2, 3, 5, 5, 9,22,7}
g*****g
发帖数: 34805
4
Use hashset

【在 m*****a 的大作中提到】
: Thanks. then how do you handle the repeat of elements?
: say; A { 1,5, 5, 8 , 7,6,5}
: B: {2, 3, 5, 5, 9,22,7}

Z****e
发帖数: 2999
5
when you build HashMap with B, let the key be elements in B, value be its
number of duplications
when you scan A, reduce the number of duplication in map when you find a
match and remove it from HashMap when it's zero

【在 m*****a 的大作中提到】
: Thanks. then how do you handle the repeat of elements?
: say; A { 1,5, 5, 8 , 7,6,5}
: B: {2, 3, 5, 5, 9,22,7}

m*****a
发帖数: 5
6
thanks, all.
1 (共1页)
进入Java版参与讨论
相关主题
学以致用,但多此一举?Java里有没有象cell array一样的东西
如何遍历hashtable里边的每一项?Collection return type and web service
如何确保每次读入的字符串都是unique的HashMap 怎样循环用更快?
问个set和literal String的问题Java 问题,请教如何找出一个array里的duplicate segments? (转载)
Simple question: delete element from collection on condition?Re: hashtable
How to check if an element is in an array? ObjectOutputStream.writeObject(Hashtable) ?
问一道关于Vector的题请教一个多线程lock机制的问题
问个数组问题传递一个object reference,如何防止更改object?
相关话题的讨论汇总
话题: question话题: hashmap话题: arrays话题: interview话题: elements