100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary WJEC A Level Computer science Unit 3 Data structures - Binary trees and linked lists £2.99
Add to cart

Summary

Summary WJEC A Level Computer science Unit 3 Data structures - Binary trees and linked lists

 25 views  0 purchase

Past paper questions and mark scheme answers for WJEC A Level Computer science Unit 3 Data structures - Binary trees and linked lists

Preview 2 out of 7  pages

  • April 10, 2023
  • 7
  • 2022/2023
  • Summary
All documents for this subject (4)
avatar-seller
nyhawkins1
Binary trees
A car dealership’s stock control system stores details of cars in a binary tree structure. The tree
structure uses manufacturers’ names as key values.
(a) Draw a representation of the binary tree using the following key values in this order:
Peugeot, Ford, Vauxhall, Mercedes, BMW, Audi, Renault, Toyota. [3]
(b) Add Jaguar to the binary tree. [1]
(c) List the key values sorted in the order that a post-order traversal of the tree would produce. [2]




A binary tree structure is designed to contain strings and uses the following rules:
● The left pointer indicates the condition “earlier or at the same position in the alphabet”
● The right pointer indicates the condition “later in the alphabet”

Construct a binary tree using these rules and the data entered in the following order:
Goat, Duck, Fox, Bear, Ant, Cat, Leopard, Owl, Mayfly, Insect, Jaguar, Emu.




(b) Carry out a pre-order traversal of the tree and give one use of pre-order traversals. [2]
● GDBACFELIJOM
● Use



7

, ○ Clone a tree
○ Count the number of leaves
○ Convert expression tree to prefix notation

(c) Carry out an in-order traversal of the tree and give one use of in-order traversals. [2]
● ABCDEFGIJLMO
● Sort/search a binary tree

(d) Carry out a post-order traversal of the tree and give one use of post-order traversals. [2]
● ACBEFDJIMOLG
● Use
○ Deleting / Undo a binary tree
○ Stack-based programming
○ Convert postfix notation to expression tree

A cloud storage solution uses binary trees for its file system. The file structures can be traversed
using a variety of methods. Describe the following methods of traversal and give an example of
how each method could be used in the file system.
In-order traversal [3] - In-order traversal is applied by visiting the left subtree first, then root and
finally the right subtree. This method could be when searching for a file in the file system
Post-order traversal [3] - Post-order traversal is applied by visiting the left subtree first, then right
subtree and finally the root. This method could be used to delete all files in the file system.
Pre-order traversal - Pre-order traversal is applied by visiting the root first, then left subtree and
finally the right subtree. This method could be used to create copy files in the file system.

Draw a representation of a binary tree using the data items from question 11(b) as key values. [3]




8

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

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

Quick and easy check-out

You can quickly pay through credit card for the summaries. There is no membership needed.

Focus on what matters

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 nyhawkins1. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for £2.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

53068 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy revision notes and other study material for 14 years now

Start selling
£2.99
  • (0)
Add to cart
Added