100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Lecture notes

2.1.2. Thinking Ahead - Computer Science

Rating
-
Sold
-
Pages
7
Uploaded on
07-04-2020
Written in
2019/2020

2.1.2. Thinking Ahead - Computer Science

Institution
OCR
Module
Unit 1








Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
April 7, 2020
Number of pages
7
Written in
2019/2020
Type
Lecture notes
Professor(s)
Unknown
Contains
All classes

Subjects

Content preview

Data Structures
Advanced Notes

Specification

1.4.2 a)
● Arrays
● Records
● Lists
● Tuples

1.4.2 b)
● Stack
● Queue Arrays, Records, Lists, and Tuples

Arrays
An array is an ordered, finite set of elements of a single type . A 1D (one-dimensional)
array is a linear array . Unless stated in the question, arrays are always taken to be zero-
indexed. This means that the first element in the array is considered to be at position
zero. Below is an example of a one-dimensional array:
________________________________________________________________________
oneDimensionalArray = [1, 23, 12, 14, 16, 29, 12] //creates a
1D array
print(oneDimensionalArray[3])
>> 14
________________________________________________________________________

A two-dimensional array can be visualised as a table or spreadsheet . When
searching through a 2D array, you first go down the rows and then across the columns
to find a given position. This is the reverse to the method used to find a set of coordinates.
Below is an example involving a two-dimensional array.
________________________________________________________________________
twoDimensionalArray = [[123, 28, 90, 38, 88, 23, 47],[1, 23, 12,
14, 16, 29, 12]]

print(twoDimensionalArray)
>> [[23, 28, 90, 38, 88, 23, 47],
£4.04
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
future170402

Also available in package deal

Thumbnail
Package deal
REVISION A - LEVEL/ AS - LEVEL OCR/AQA COMPUTER SCIENCE PAPER 2
-
1 11 2020
£ 44.44 More info

Get to know the seller

Seller avatar
future170402
View profile
Follow You need to be logged in order to follow users or courses
Sold
1
Member since
5 year
Number of followers
1
Documents
24
Last sold
3 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions