How to find duplicates in an array and remove them
efficiently?
Answer Posted / vishnu
Dim a(4)
a(0) = 1
a(1) = 4
a(2) = 5
a(3) = 4
a(4) = 5
For i = ubound(a)-1 to 0 step - 1
For j=0 to i
If a(j) = a(j+1) Then
a(j) = empty
ElseIf a(j)>a(j+1) Then
temp = a(j+1)
a(j+1) = a(j)
a(j) = temp
End If
Next
Next
For i=0 to ubound(a)
print a(i)
Next
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the Disadvantages of shared object repository?
What are the various types of Actions in UFT?
How many add-ins comes by default with qtp?
how to disable the pop ups through QTP using a script
What is RTM (require ment tracebulity marix) fromate?
How to use reporter.report event in qtp ?
explain abt dyanamic changing object with example?
What are the different types of action?
How to create Reusable and Multiple Actions?
Which scripting language used by quicktest professional?
Explain the types of object repository?
What are the two types of repositories available, explain them?
terminal services client
what is the diffrence bw qtp architectute and qtp framework?
Can anyone help.i need total excelsheet operations,shortcuts in testing environment from starting onwards....