How to find duplicates in an array and remove them
efficiently?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / crazy boy
**How to find duplicates in an array and remove them efficiently?
=================================================
dim a(4)
a(0)=10
a(1)=20
a(2)=10
a(3)=20
a(4)=50
for i=0 to ubound(a)
for j=i+1 to ubound(a)
if a(i)=a(j) then
a(i) =empty
end if
next
next
for i=0 to ubound(a)
if a(i)<>"" then
msgbox a(i)
end if
next
Is This Answer Correct ? | 1 Yes | 0 No |
how qtp identifies objects of application.
Explain types of descriptive programming?
How can we export test results to an excel sheet in QTP??? Can any one provide sample coding for this?????
What is method name to compare two XML files.
how can you describe the basic flow of automation with conditional and programmatic logic?
why require regression testing?
Explain the concept of object repository and how qtp recognises objects?
how can we know the program is testing by multiple test data in data driven frame work?
what is batch run ?
Why is action split used by qtp?
How to explain a banking project in interview as a test engineer???
Hi All, I need code for how to execute qtp scripts from excell sheet