In this Computer Science Rap, we get into Arrays
Enjoy!
#IntroToCode #ComputerScience #AlwaysBeCoding
Social Media:
Instagram: https://bit.ly/2VlqQ7n
🎶Lyrics🎶
Always Be Coding [4] - Arrays
Written by Mike W
[Verse: Intro]
You practiced variables and you got those mastered
But summoning so many feeling kinda drastic
What if you expect hundreds of a data type
Declaring all those variables, would take all night
[Hook]
Hey, there has to be another way
Wait, write an Array!
When you need to organize many of the same data type
You can get away with Arrays!
[Verse: Explanation]
An array is a block of memory
Storing many elements sequentially
With an index operator for accessibility
You’ll be making arrays for eternity!
[Verse: Implementation]
Declare an array with a data type
Give it a name and then a size
The size divides the length of array
Each section has an address for it’s index or place
First element, index zero
Second element, index 1
Third element, index 2
The pattern continues until size minus 1
After the array gets the data
Access any index - teleportation chamber
That means you can skip to any location
Giving fastest access to information
In terms of performance, takes the cake
For your first Data Structure, make an Array!
[Hook]
Oh, hey, hey
Don’t forget about your Arrays
When you need to organize many of the same data type
You can get away with Arrays!