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

Lecture Notes on Lists II and Binary Trees (COMP11120)

Rating
-
Sold
-
Pages
2
Uploaded on
30-05-2024
Written in
2023/2024

Enhance your understanding of advanced list operations and binary trees with these comprehensive lecture notes for COMP11120. Covering essential topics such as list manipulation, traversal techniques, binary tree structures, and tree traversal algorithms, these notes are designed to provide you with a clear and concise understanding of the subject matter. Ideal for students enrolled in COMP11120 or those seeking to deepen their knowledge independently, these notes offer structured explanations, practical examples, and key insights to help you excel in your studies and exams. Get your copy now and master Lists II and Binary Trees with ease!

Show more Read less








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

Document information

Uploaded on
May 30, 2024
Number of pages
2
Written in
2023/2024
Type
Lecture notes
Professor(s)
Andrea schalk
Contains
More on lists, and introduction to binary trees

Content preview

More on Lists, and Introduction to Binary Trees

Binary Trees

Terminology
L root
in a
binary tree every mode >
- in a full binary tree
, every node


7
has at most 2 children
. ·
is either a leaf

leaves & · or has a left and right child , which themselves are the root of a tree.


full binary tree
T 7 in a
every node

has 0 or 2 children
. - a full binary tree consists of


· either just a root mode


· or a root and a left and a right (subtree.




Full Binary Trees
Definition A full binary tree with labels from set S base Step case
: a is given
by case




basecase trees where seS tree S 7 S treeg (t t) ,
> S
,



Step case Given trees t ,
t with labels from S
, t t

treeg (t ,
tl) is a tree with labels from S
.




Example : trees (treen (troes treez) , , treed


3
#
*
-
H 04
#

3 28





FBTreess : set of all full binary trees with labels from S
.



Example Define
: operation FBTreess <
IN that returns the height of Example : Give an operation no :
FiTreess > 11I that returns the
tree number of nodes tree
a .

of a .




base case Light (trees) = D base case noltroos) =
1

Step case Light (trees (t t)) ,
= 1 + max light , light ↑
Step case no(troeg(t ,
t) = not + not + 1




Example : Show that for all to FBTroesg ,
light not Example : Show that for te FBTreesg ,
not is old




base case Light trees = 0 1 = no trees base case noltrees) = 1 which is odd


Step case
hight (treeg(t t ,
=
1 + max (lightt lightt) , ind .
hyp not , not' are odd
max(a, b) ( a + b

& 1 +
light + lightt Step case nol trees (t t) = 1 + not + not
,


not not E *

>
- 1 + + indhyp by ind .
hyp . We can find i
,
je IN such that

= no (trees (t , tl) not = 2i + 1


not =
2j + 1

L


= 1 + 2i + 1 + 2j1
= 1 + 2(i + j +
1)

=
1 + even


= odd
£5.49
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
jpxoi

Also available in package deal

Thumbnail
Package deal
Complete Semester 2 Lecture Notes Bundle
-
8 2024
£ 49.92 More info

Get to know the seller

Seller avatar
jpxoi The University of Manchester
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
1 year
Number of followers
0
Documents
20
Last sold
-

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