473,396 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Need help recoding a function

Hi all

I have this function that i want to edit. At present this function takes an arraylist and retrieves the index of the smallest interger contained in the arraylist
What i want to do is modify this so that it retrieves the top 10 indexes of the smallest to largest intergers in a arraylist

i.e if arraylist1 contains (2, 4, 1, 3, 1, 5, 1, 0
i want the function to return the indexes in order of the smallest to the largest. In this case it would be: 7, 2, 4, 6, 0, 3, 1,

Public Function GetIndexOfSmallestNumber(ByVal a As ArrayList) As Int3
Dim nSmallestValue As Int3
Dim nSmallestIndex As Int3

nSmallestValue = a.Item(0
nSmallestIndex =
For i = 1 To a.Count -
If a.Item(i) < nSmallestValue The
nSmallestIndex =
nSmallestValue = a.Item(i
End I
Next
Return nSmallestInde
End Functio

Can anyone offer any assistance?
Jul 21 '05 #1
1 824
Cor
Hi Bhavna,

It is nice that you try to use that sort from the time of the first sample
Pascal programs, but maybe it is better to have a look at this.

It looks difficult, but I think that has more to do because of the way they
wrote the sample than the rest.
http://msdn.microsoft.com/library/de...sSortTopic.asp

I hope this helps?

Cor
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Google Mike | last post by:
I need help from PHP land. I've just completed an open source work order management system in PHP on Linux (RH9). I plan to use an Apache license, which was recommended by a friend, so that I can...
10
by: Jeff Wagner | last post by:
I am in the process of learning Python (obsessively so). I've been through a few tutorials and read a Python book that was lent to me. I am now trying to put what I've learned to use by rewriting...
8
by: JustSomeGuy | last post by:
I need to write an new class derived from the list class. This class stores data in the list to the disk if an object that is added to the list is over 1K in size. What methods of the std stl...
6
by: J Mox | last post by:
I have a function that changes which radio button is selected. I need to pass the form name to the function but not the field name and am doing so like: changeRadio(this.form); The function: ...
6
by: Chad A. Beckner | last post by:
Does anyone know how to make common database connections "common" in all aspx files? In other words, instead of creating a SQLConnection, then a DataAdapter in every ASPX file for my application,...
3
by: Buddy Robbins | last post by:
Hey folks, I'm trying to use the PathCleanupSpec function from the shell library. The function prototype is: int PathCleanupSpec( LPCWSTR pszDir, LPWSTR pszSpec) In the old days of VB6, I...
66
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it...
0
by: Alexey Kulentsov | last post by:
1. First of all, XMLHttpRequest have idiotic API. onreadystatechange handler have no parameters! (Thanks to Microsoft) So if you have more then one request on same page for different resources you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.