We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LDArray extension
#2
Hi Yumda,

Thanks for your question.

We know that SB arrays can be slow or even very slow for large, espacially multi-dimensional arrays.

For 1D arrays I recomment using LDList - this is fast, effiecient, easy to add, remove, sort etc and you don't have to set the max dimension size to start with (its a dynamic sizing list).

LDFastArray is designed for multi-dimansional arrays.

So, back to LDArray, which is the fastest 1D array (in C# anyway), I still probably recommend LDList since it is more flexible and probably similar performance in SB.

If you want a specific example and one of the methods, then ask, but here is a simple example of its use.

Code:
dim = 10000
array = LDArray.Create(dim)
For i = 1 To dim
  LDArray.SetValue(array,i,Math.GetRandomNumber(dim))
EndFor
TextWindow.WriteLine("Array created")
LDArray.Sort(array)
TextWindow.WriteLine("Array sorted")
For i = 1 to 10
  TextWindow.WriteLine(LDArray.GetValue(array,i))
EndFor


So, depending on your use, I recommend LDList for 1D, LDFastArray for multi-dimensional lists, and if you want to use LDArray and have specific questions on it, then please ask.
Reply


Messages In This Thread
LDArray extension - by Yumda - 11-17-2024, 10:05 PM
RE: LDArray extension - by litdev - 11-17-2024, 11:20 PM
RE: LDArray extension - by Yumda - 11-18-2024, 01:34 AM
RE: LDArray extension - by z-s - 11-18-2024, 04:36 AM
RE: LDArray extension - by AbsoluteBeginner - 11-18-2024, 09:17 AM
RE: LDArray extension - by Yumda - 11-18-2024, 11:23 PM
RE: LDArray extension - by AbsoluteBeginner - 11-19-2024, 06:54 AM
RE: LDArray extension - by AbsoluteBeginner - 11-19-2024, 07:24 AM
RE: LDArray extension - by AbsoluteBeginner - 11-19-2024, 09:56 AM
RE: LDArray extension - by Yumda - 11-19-2024, 01:30 PM
RE: LDArray extension - by litdev - 11-19-2024, 01:53 PM
RE: LDArray extension - by AbsoluteBeginner - 11-19-2024, 05:16 PM
RE: LDArray extension - by Yumda - Yesterday, 01:22 AM
RE: LDArray extension - by litdev - Yesterday, 07:40 AM
RE: LDArray extension - by AbsoluteBeginner - Yesterday, 07:57 AM
RE: LDArray extension - by jrmrhrb00 - Yesterday, 02:23 PM
RE: LDArray extension - by Yumda - Today, 12:22 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)