answersLogoWhite

0


Best Answer

boolean containsDuplicate(final Vector v) {

// Iterate through each element in v...

for (int i = 1; i < v.size(); ++i) {

// For each element, check to see if there's a duplicate...

for (int j = 0; j < i; ++j) {

// If so, return true

if (v.get(i).equals(v.get(j))) {

return true;

}

}

}

// If we get here, then we have found no duplicates - return false

return false;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a java program to identify a duplicate value in a vector?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Would you identify a problem in mechanical engineering and develop a program to solve it by drawing a flowchart writing a pseudo code that satisfies the flowchart and write the c code for the program?

I really don't understand you.....


Write a program to convert stack into queue using c language?

In order to write a program to convert stack into queue using c language you must be able to identify the proper program. Having a special certification in programing will be beneficial as well to make sure you recognize the proper queues for the programs.


What tool is used to duplicate blocks on TheVoxelBox in Minecraft?

write&quot;/more&quot; in comands


How do you write a sentence with identify in it?

They tried to identify the unknown character.


How do you write application to principal for lost my mark sheet?

You can write a letter to the principal explaining that you have lost your mark sheet and requesting a duplicate copy. Include details such as your name, roll number, date of birth, and any other information that can help them identify your records. Be polite and provide a genuine reason for the request.


What is the problem identification stage?

Forecasters must identify what is going to be forecasted, or what is of primary concern. There must be a timeline attached to the forecasting period. This will help the forecasters to determine the methods to be used later.


How to write program for secant method in mathematica?

How to write a program for secant method by mathematica


Could you write a sentence with this word identify?

I would like for you to identify this insect, please.


How can I stop Open Office Writer from inserting a date 01slash04slash09 when I write 1-4?

I tried to duplicate your 'error' - and it didn't do it on my copy of writer (OpenOffice version 3.3) - However, in the Calc program, it did change the format. The solution there, was to re-format the cell.


Write a program in Lex to eliminate white space and collect numbers as a token?

write a lex program to delete space from the program


How do you write Square program using vb?

write a vb program to find the magic square


Write a program to multiply 33 matrix.?

write a program to multily 3*3 matrix.