Transform your computer science education with our comprehensive guide to Arrays and Abstract Data Types. Designed specifically for the OCR H446 curriculum, this document is the ultimate study tool for anyone looking to excel in computer science. With clear and concise explanations alongside with c...
Abstract Data Type: A data type created by the programmer themselves.
Tuple: A data structure that is immutable/unchangeable and in sorted order.
Records: A data structure where there is a fixed number of variables, each one is called a field and they each have an
identifier called a field name and a data type. Each field in a record can have a different data type, e.g. character, string,
integer, bool, real/float.
Array:
A data structure that holds a number of data items or elements of the same data type.
An array can be declared using a single identifier and can be used efficiently using iteration.
Each position in an array is identified by an index, the first item in an array is at index 0.
The contents of an array is stored next to each other in the sequence given, in main memory. Therefore each position in
the array can be accessed directly, this is good for high performance algorithms and such.
Values stored in an array are mutable, therefore they can be changed while the program is running like a list and unlike a
tuple.
There are 1D, 2D and 3D Arrays:
This is a 1D array, it can be visualized as a single row of values.
ARRAY spelling_words[10] #Declare an array of 10 elements
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller ripple. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $4.51. You're not tied to anything after your purchase.