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

list, array or collection for storing and sorting numbers ?

Hello
What is the best practice to have few random numbers to be sorted in
ascending or descending way? array, list, collection ?












http://www.scalpa.info
http://scalpa98.blogspot.com/
Oct 31 '08 #1
3 1450
"eBob.com" <eB******@totallybogus.comschrieb
Could you explain the following line in the code you posted above ...
If Not Unique OrElse Not Result.Contains(Value) Then
I don't understand "Unique". Even if you were posting pseudocode I am
still confused because
Not Result.Contains(Value) is the same thing as unique, isn't it?
Unique is a parameter that I took from you own declaration. My
interpretation was that it should tell the function if each random number
has to be unique in the array. So, the condition means: If the values don't
have to be unique (Not Unique), or, otherwise (OrElse), if the value is not
in the list yet (Not Result.Contains), then add it to the list (Result.Add).
Armin

Nov 2 '08 #2

"Armin Zingler" <az*******@freenet.dewrote in message
news:ul**************@TK2MSFTNGP06.phx.gbl...
"eBob.com" <eB******@totallybogus.comschrieb
>Could you explain the following line in the code you posted above ...
If Not Unique OrElse Not Result.Contains(Value) Then
I don't understand "Unique". Even if you were posting pseudocode I am
still confused because
Not Result.Contains(Value) is the same thing as unique, isn't it?

Unique is a parameter that I took from you own declaration. My
interpretation was that it should tell the function if each random number
has to be unique in the array. So, the condition means: If the values
don't have to be unique (Not Unique), or, otherwise (OrElse), if the value
is not in the list yet (Not Result.Contains), then add it to the list
(Result.Add).
Armin
Thanks Armin. I wasn't the OP and didn't look closely enough at his code.
While I am at it ... thanks for all your posts, in response to my questions
and those of others, from which I have learned so much.

Bob
Nov 3 '08 #3
"eBob.com" <fa******@totallybogus.comschrieb
>
Thanks Armin. I wasn't the OP
Ah, sorry! Didn't look carefully at the sender. Next time I will. :-)
Armin
Nov 3 '08 #4

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

Similar topics

4
by: KellyH | last post by:
Hi, I hope someone can point me in the right direction. I'll get it out of the way: Yes, I am a college student. No, I am not looking for anyone to do my homework, just looking for help. I have...
7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
5
by: Eric Lilja | last post by:
Hello, consider this complete program (sorry, it's not minimal but I hope it's readable at least): #include <algorithm> #include <iostream> #include <vector> class Row { public:
18
by: Scott | last post by:
I have a collection where the items in the collection are dates. I want to iterate over the collection and build a value list string for the rowsource of a listbox. The dates in the collection are...
3
by: chellappa | last post by:
hi this simple sorting , but it not running...please correect error for sorting using pointer or linked list sorting , i did value sorting in linkedlist please correct error #include<stdio.h>...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
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...
10
by: pamelafluente | last post by:
Hi I have a sorted list with several thousands items. In my case, but this is not important, objects are stored only in Keys, Values are all Nothing. Several of the stored objects (might be a...
15
by: Macca | last post by:
Hi, My app needs to potentially store a large number of custom objects and be able to iterate through them quickly. I was wondering which data structure would be the most efficient to do this,a...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.