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 is the virtual object?
Explain the features of quick test pro(qtp)?
Explain advantages and disadvantages kdf?
Hi, I am supposed to automate mainframe application through qtp. I do not know how to start abt it. Can you plz help me in first initializing the process or do you anybody have a guide book or a link which guides me through the process of automating the mainframe applications and things involved in it.
I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.
please any one can explain the keyword driven framework. with gmail example.
What are the ordinal identifiers in web page?
can any one please tell me which is the best institute in Bangalore to learn QA (crash course)? Thanks
Explain the checkpoint in qtp?
What is the process of synchronizing qtp and aut?
Hi Friends this is kumar i would like to request to all of you ,please help me to explain real time project with using qtp scripts i know basics of qtp but it won't workout on interviews,pls help awating to reply.
Whether qtp 9.0 supports Test director8.0
How smart identification works in qtp ?
How you can find length of array in qtp?
How software tester can use constants and variables in scripts?