100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class 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
Course








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

Written for

Study Level
Examinator
Subject
Unit

Document information

Uploaded on
April 7, 2020
Number of pages
7
Written in
2019/2020
Type
Class 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],
$5.59
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

Get to know the seller

Seller avatar
future170402
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 tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Frequently asked questions