1.1.12
Merge Sort
Merge Sort
Merge Sort
Merge sort is an example of a divide and conquer algorithm, where the problem is broken down into smaller steps.


The concept
The concept
- If we have two packs of cards, which are both already in order and want to combine them, what can we do?
- One solution is to only consider the top card of each pile, and create a new deck starting from the smaller of the two cards.
- This will give us a combined sorted pack.
- This is called merge sort.


In English
In English
- Split the lists into lists of size one.
- Merge each pair of sublists by comparing the first value of each list and putting the smaller value into the new list first.
- Continue merging until there is only one list.


Pros and cons of merge sort:
Pros and cons of merge sort:
- Pros:
- A very efficient algorithm.
- Cons:
- Can be slower for small lists.
- Needs additional memory.
Merge Sort
Merge Sort
Merge sort is an example of a divide-and-conquer algorithm, where the problem is broken down into smaller steps.


The concept in the context of cards
The concept in the context of cards
- If we have two packs of cards, which are both already in order and want to combine them, what can we do?
- One solution is to only consider the top card of each pile, and create a new deck starting from the smaller of the two cards.
- This will give us a combined sorted pack.
- This is called merge sort.


The process
The process
- Split the lists into lists of size one.
- Merge each pair of sublists by comparing the first value of each list and putting the smaller value into the new list first.
- Continue merging until there is only one list.


Pros and cons of merge sort
Pros and cons of merge sort
- Pros:
- A very efficient algorithm.
- Cons:
- Can be slower for small lists.
- Needs additional memory.
1Problem Solving
1.1Algorithms
1.2Decomposition & Abstraction
2Programming
2.1Develop Code
2.2Constructs
2.3Data Types & Structures
2.6Subprograms
3Data
3.2Data Representation
3.3Data Storage & Compression
3.4Encryption
4Computers
4.1Machines & Computational Modelling
4.2Hardware
4.2.1Elements of Computer Systems
4.2.2Types of Computer Systems
4.2.3Memory - RAM
4.2.4Memory - ROM
4.2.5Memory - Cache
4.2.6Running Out of Memory
4.2.7Virtual Memory
4.2.8Magnetic Storage
4.2.9Properties of Magnetic Media
4.2.10Examples of Magnetic Storage
4.2.11Solid State Storage
4.2.12Properties of Solid State Media
4.2.13Optical Storage
4.2.14Properties of Optical Storage
4.2.15Examples of Optical Storage
4.2.16Types of Optical Disk
4.2.17Von Neumann Architecture
4.2.18Registers of the Central Processing Unit (CPU)
4.2.19Fetch-Decode-Execute Cycle
4.2.20Factors Affecting CPU Performance
4.2.21The Cloud
4.2.22How the Cloud Works
4.2.23The Cloud - Pros
4.2.24The Cloud - Cons
4.2.25End of Topic Test - Hardware
4.4Software
5Communication & The Internet
5.1Networks
5.1.1Benefits of Networks
5.1.2Network Performance
5.1.3Types of Network
5.1.4Client-Server Model
5.1.5Pros of Client-Server Model
5.1.6Cons of Client-Server Model
5.1.7Peer-to-Peer Model
5.1.8Pros of Peer-to-Peer Model
5.1.9Cons of Peer-to-Peer Model
5.1.10Network Hardware
5.1.11Transmission Media
5.1.12WiFi
5.1.13WiFi Frequency and Channels
5.1.14WiFi Encryption
5.1.15Network Protocols
5.1.16Transmission Protocols
5.1.17Web Protocols
5.1.18Email Protocols
5.1.19Layers
5.1.20TCP and OSI Models
5.1.21Advantages of Layering
5.1.22Topology - Star
5.1.23Topology - Mesh
5.1.24Topology - Ring
5.1.25Topology - Bus
5.1.26End of Topic Test - Networks
5.2Network Security
6The Bigger Picture
6.1Emerging Trends, Issues & Impact
6.1.1E-Waste
6.1.2Energy Consumption
6.1.3Positive Environmental Impact
6.1.4Ethical Issues - The Digital Divide
6.1.5Ethical Issues - Net Neutrality
6.1.6Ethical Issues - Working Conditions
6.1.7Ethical Issues - Censorship
6.1.8Online Activity Tracking
6.1.9The Internet of Things
6.1.10Positive Cultural Impacts
6.1.11Negative Cultural Impacts
6.1.12Data Protection Act
6.1.13Computer Misuse Act
6.1.14Copyright Designs and Parents Act
6.1.15Creative Commons Licensing
6.1.16Freedom of Information Act
6.1.17Open Source Software
6.1.18Proprietary Software
6.1.19Licensing Issues
6.1.20End of Topic Test - Software & Issues
Jump to other topics
1Problem Solving
1.1Algorithms
1.2Decomposition & Abstraction
2Programming
2.1Develop Code
2.2Constructs
2.3Data Types & Structures
2.6Subprograms
3Data
3.2Data Representation
3.3Data Storage & Compression
3.4Encryption
4Computers
4.1Machines & Computational Modelling
4.2Hardware
4.2.1Elements of Computer Systems
4.2.2Types of Computer Systems
4.2.3Memory - RAM
4.2.4Memory - ROM
4.2.5Memory - Cache
4.2.6Running Out of Memory
4.2.7Virtual Memory
4.2.8Magnetic Storage
4.2.9Properties of Magnetic Media
4.2.10Examples of Magnetic Storage
4.2.11Solid State Storage
4.2.12Properties of Solid State Media
4.2.13Optical Storage
4.2.14Properties of Optical Storage
4.2.15Examples of Optical Storage
4.2.16Types of Optical Disk
4.2.17Von Neumann Architecture
4.2.18Registers of the Central Processing Unit (CPU)
4.2.19Fetch-Decode-Execute Cycle
4.2.20Factors Affecting CPU Performance
4.2.21The Cloud
4.2.22How the Cloud Works
4.2.23The Cloud - Pros
4.2.24The Cloud - Cons
4.2.25End of Topic Test - Hardware
4.4Software
5Communication & The Internet
5.1Networks
5.1.1Benefits of Networks
5.1.2Network Performance
5.1.3Types of Network
5.1.4Client-Server Model
5.1.5Pros of Client-Server Model
5.1.6Cons of Client-Server Model
5.1.7Peer-to-Peer Model
5.1.8Pros of Peer-to-Peer Model
5.1.9Cons of Peer-to-Peer Model
5.1.10Network Hardware
5.1.11Transmission Media
5.1.12WiFi
5.1.13WiFi Frequency and Channels
5.1.14WiFi Encryption
5.1.15Network Protocols
5.1.16Transmission Protocols
5.1.17Web Protocols
5.1.18Email Protocols
5.1.19Layers
5.1.20TCP and OSI Models
5.1.21Advantages of Layering
5.1.22Topology - Star
5.1.23Topology - Mesh
5.1.24Topology - Ring
5.1.25Topology - Bus
5.1.26End of Topic Test - Networks
5.2Network Security
6The Bigger Picture
6.1Emerging Trends, Issues & Impact
6.1.1E-Waste
6.1.2Energy Consumption
6.1.3Positive Environmental Impact
6.1.4Ethical Issues - The Digital Divide
6.1.5Ethical Issues - Net Neutrality
6.1.6Ethical Issues - Working Conditions
6.1.7Ethical Issues - Censorship
6.1.8Online Activity Tracking
6.1.9The Internet of Things
6.1.10Positive Cultural Impacts
6.1.11Negative Cultural Impacts
6.1.12Data Protection Act
6.1.13Computer Misuse Act
6.1.14Copyright Designs and Parents Act
6.1.15Creative Commons Licensing
6.1.16Freedom of Information Act
6.1.17Open Source Software
6.1.18Proprietary Software
6.1.19Licensing Issues
6.1.20End of Topic Test - Software & Issues
Unlock your full potential with Seneca Premium
Unlimited access to 10,000+ open-ended exam questions
Mini-mock exams based on your study history
Unlock 800+ premium courses & e-books