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 |
Hi Frriends... I have one Query please give the apropriate ans. when we r working with web based application , the user loggedin page name is changed respect to the username ( Take a exp. Yahoomail.com) .When we use Datadriven test to this scenario ,each time the loggedin page name is changed ...then the script is fail.. at that time wat can do... please give the apropriate ans. Thanx in advance..
Hello friends can anybody tell me about the architecture of QTP with diagram of it.this architecture is same for any domain like ERP/Banking/CRM/Healthcare or it's different then please tell me.thanks
How can I use the value retrieved by OUTPUT VALUE check point as Input for other Actions?
How can i Save the snapshots in a specified folders using Scripting in QTP?
4. what is the use of Text output value in Qtp?
What is difference between WR and QTP?
Hi Friends,I hav Just finished QTP course.Can any body suggest me which is the best place to go and post resume(Ban,Chennai,Pune,Mumbai,NCR,Kolkata).I mean how r calls in these cities,the best one?
How did you achieve reusability via QTP?
What is quick test pro?
how to run the script If QTP tool not identify object in web page
How to covert a String to an integer?
What is an object repository?