Suppose you need to store several numerical values. In terms of of speed and memory which of the following is the best way to do it.

:1->A
:2->B
:3->C

or

:{1,2,3}->L1
It all depends on what you're going to do with those variables. If you have 100 points to track in a statistics program, you'll want to use two 100-item lists, one for the X coordinates, one for the Y coordinates. If you're storing the three leg lengths of a triangle, then A, B, and C are probably fine. Relevantly, I'll soon be publishing Part 3: Variables, Lists, and Matrices in my Using the TI-84 Plus CE video series. For programming, I strongly recommend you take a look at Programming the TI-83 Plus/TI-84 Plus if you haven't already; it answers many of these questions.
In both respects

Code:
``` {1,2,3->L1 ```

is faster than

Code:
``` :1->A :2->B :3->C ```

. You can also leave off the ending parenthesis or parentheses when using the STO command, because it automatically parses the parentheses on whether it is on or not.
Edit: Ninja'd

I also forgot to say that depending on how many times you have to access the variables, using A B and C will take less space, but I'm not sure about time.

Method 1 is using several real vars.
Good because they can be managed independently, because they are just always temporary files and you never worry about overwriting anything. Also, unlike lists you need to use only 1 byte to adress each var.

Method 2 is using a List:
Can be handled as whole (eg. L1+1-> L1 increments every entry in the list efficiently) is clean because using only one var and it has the advantage that you can create user defined lists. Unfortunately you need at least 3 bytes to adress a list's entry.

Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

»
» All times are UTC - 5 Hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum