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 |
When should I use smart identification?
i need the licence key for QTP V9.5 can anyone help me on getting this?
In application which areas to be automated and what kind of situation will be take? using QTP? Plz give me the clear answer
0 Answers Tavant Technologies,
how to write script in qtp(vbscript)..i mean with out application deployed..and how to call script1 into script2?
How to analyzing test results using quicktest professional (qtp)?
When i use paramateriztion for tickets in flight reservation application , the tes'll run for first iteration but for the second iteration it'll give this details, but the second iteration is failed. Pls anyone clarify it. Cannot find the "Agent Name:" object's parent "Login" (class Dialog). Verify that parent properties match an object currently displayed in your application.
What is OUTPUT VALUE ? PLZ Explain With Example?
what is Property......End Property loop? how to write sript for it in QTP
In the website, the protocol has been changed http: to https what you will do? Tell me your approach?
If object is not recognized by qtp but the object is standard object what is your approach?
Hai anyone please "Explain about Framework in QTP?"
How to Synchronize the Browser at Field level? For example if you put Browser.sync(), its waiting upto for that Browser sync only. It should wait total Browser get upload with fields.