473,385 Members | 1,582 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,385 software developers and data experts.

Sort Integer Array

' Given

Dim v(19) As Integer ' a 20 element array

Dim vSorted(19) As Integer

Dim i As Integer

' The array v() is filled with random numbers

' It is then copied into vSorted()

then

Array.Sort(vSorted) ' is attempted but it seems to be a string sort

' and not a numeric sort.

' So in vb.net 2008, how does one code a numeric sort ?

BR

Bob
Jun 27 '08 #1
1 2397
It works for me. I suggest you run in the debugger with breakpoints before
and after Array.Sort(vSorted) and see what is happening.

"Bob Palank" wrote:
' Given

Dim v(19) As Integer ' a 20 element array

Dim vSorted(19) As Integer

Dim i As Integer

' The array v() is filled with random numbers

' It is then copied into vSorted()

then

Array.Sort(vSorted) ' is attempted but it seems to be a string sort

' and not a numeric sort.

' So in vb.net 2008, how does one code a numeric sort ?

BR

Bob
Jun 27 '08 #2

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

Similar topics

4
by: its me | last post by:
Let's say I have a class of people... Public Class People Public Sex as String Public Age as int Public Name as string end class And I declare an array of this class...
5
by: Irfan Mumtaz | last post by:
hi, I had posted a question in the group "how to arrange arrays in increasing order" Although i got an answer using IComparable Interface by Harfried ,which is given below. Dim InputArray()() As...
3
by: aprivate | last post by:
Hi I tried all the examples in the visual studio IDE but the array.sort (array,icomparer) examples fails to work in VB.NET for Smart Devices.. its get an error before it is compiled... Is...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
48
by: Alex Chudnovsky | last post by:
I have come across with what appears to be a significant performance bug in ..NET 2.0 ArrayList.Sort method when compared with Array.Sort on the same data. Same data on the same CPU gets sorted a...
13
by: ralphedge | last post by:
These sorts work fine on 100000 ints but if I go much higher they will both segmentation fault **************************MERGESORT********************* mergesort(int *a, int size) //a is...
17
by: rhitz1218 | last post by:
Hi, I'm trying to create a function that will sort a number's digits from highest to lowest. For example 1000 - will become 0001 or 1234 to 4321
1
by: Bob Palank | last post by:
' Given Dim v(19) As Integer ' a 20 element array Dim vSorted(19) As Integer Dim i As Integer ' The array v() is filled with random numbers
0
by: Bob Palank | last post by:
' Given: Dim v(19) As Integer ' a 20 element array Dim vSorted(19) As Integer Dim i As Integer ' The array v() is filled with random numbers
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.