Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 9 pages
Exam (elaborations)

COMPUTING PAPER 2 H446 EXAM QUESTIONS AND ANSWERS 100% CORRECT!!!!! (GRADED A+)

Document preview thumbnail
Preview 2 out of 9 pages

State what type of pointers are used to store nodes I, F, J and H so they do not point to any other nodes [1] - ANSWER null pointers Kira wants the program to traverse the tree to evaluate the range of possible moves. She is considering using a breadth-first traversal or a depth-first (post-order) traversal. Show how a breadth-first traversal would traverse the tree shown in Fig. 1 [4] - ANSWER Use A as starting node Then visit the nodes B then C then E Then visit D then F then G then H Then finally visit I and J Kira wants to make some changes to the data that is stored in the tree structure shown in Fig. 1. The move represented by node 'E' needs to be deleted. Describe the steps an algorithm will follow to delete node 'E' from the tree [3] - ANSWER Search location to find the node E Create a new node with the value K Add a pointer from node G to the new node The move represented by the node 'K' needs to be added. Node 'K' needs to be joined to node 'G.' Describe the steps the algorithm will follow to add node 'K' to the right of node 'G' [3] - ANSWER Search the tree to find the location of node G Create a new node with value K Add a pointer from node G to the new node Give two similarities and two differences between a tree and a graph structure [4] - ANSWER Both consists of nodes Both are connected by links Tree is one directional whereas graph is 2 directional Tree will not have cycles whereas graphs can have cycles Explain why decomposition can help the development of the program [4] - ANSWER Decompo

Content preview

COMPUTING PAPER 2 H446 EXAM
QUESTIONS AND ANSWERS 100%
CORRECT!!!!!
(GRADED A+)

, How kira has used abstraction in design of her tree [3] - ANSWER It removes any
unnecessary detail
The actual movements are shown as lines
The tree does not show any information about what the moves are

State why the tree in Fig. 1 is not an example of a binary tree [1] - ANSWER The nodes
arent ordered

State what type of pointers are used to store nodes I, F, J and H so they do not point to
any other nodes [1] - ANSWER null pointers

Kira wants the program to traverse the tree to evaluate the range of possible moves.
She is considering using a breadth-first traversal or a depth-first (post-order) traversal.

Show how a breadth-first traversal would traverse the tree shown in Fig. 1 [4] -
ANSWER Use A as starting node
Then visit the nodes B then C then E
Then visit D then F then G then H
Then finally visit I and J

Kira wants to make some changes to the data that is stored in the tree structure shown
in Fig. 1.

The move represented by node 'E' needs to be deleted.

Describe the steps an algorithm will follow to delete node 'E' from the tree [3] -
ANSWER Search location to find the node E
Create a new node with the value K
Add a pointer from node G to the new node

The move represented by the node 'K' needs to be added. Node 'K' needs to be joined
to node 'G.'

Describe the steps the algorithm will follow to add node 'K' to the right of node 'G' [3] -
ANSWER Search the tree to find the location of node G
Create a new node with value K
Add a pointer from node G to the new node

Give two similarities and two differences between a tree and a graph structure [4] -
ANSWER Both consists of nodes
Both are connected by links

Document information

Uploaded on
January 15, 2025
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Luckyexams
3.2
(6)
Sold
29
Followers
2
Items
2272
Last sold
3 months ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions