Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 27

For questions regarding the data storage structure of an Array. This can range from their standard indexing to their usage in comparison to other data structures. Arrays are an ordered list of elements which are usually all of the same type. Nested arrays can contain arrays as elements.

22
votes
When I've explained this to beginning students, I don't stray far from your third reason, though I agree that the beginning of arrays is early to introduce the concept of memory addresses. Among … to use arrays correctly. But if you want a hint about why we actually do this, you can think about zero-based indexing as the distance from the head of the array. So, if I'm at the head of the …
answered Sep 3 '18 by Ben I.
31
votes
You can get at this concept very intuitively in strings before you ever get to arrays. Take a string like "hello world" and ask them a subtle-sounding point: does the string begin here: "*hello … DISTANCE from the start. So, if we want the first character, we move no distance. And how far do we move to get the 3rd character? ..." When you later get to arrays, you can remind them of the concept, and just say that it is being used again here. …
answered May 27 '17 by Ben I.
7
votes
A variant on the ENIGMA machine encryption works well in a single loop, and is sufficiently complex to give students a real challenge. The core idea of the ENIGMA machine for this assignment is that …
answered Dec 15 '17 by Ben I.
1
vote
One small, but significant, algorithm is to find Euler's Number. The irrational number $e$, also called Euler’s number, is approximately 2.71828. The number is significant both to the culture of com …
answered Dec 15 '17 by Ben I.
4
votes
Hmm, here are a few ideas: Calculating student GPA where the grades are all stored in an array of arrays, and the different semesters have different numbers of courses. Make a lookup table of prime … factors. Consider an array of arrays of paths to hike, and local maximum / local minimum elevations passed along the way. Since there will be a different number of local maxima/minima along the way …
answered Jan 10 by Ben I.