answersLogoWhite

0

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

15y ago

What else can I help you with?

Related Questions

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.


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.....


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

write&quot;/more&quot; in comands


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.


How do you write a sentence with identify in it?

They tried to identify the unknown character.


How to write program for secant method in mathematica?

How to write a program for secant method by mathematica


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.


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.


Write a program to illustrate the usage of pointers with arrarys and functions?

* * * * * * * * * * write the c++ program and show me brifily?