Faculty of Engineering and Mathematical Sciences 
Not logged in (login)


This forum is provided to promote discussion amongst students enrolled in Data Structures and Algorithms (CITS2200).
RSS cloud
Jump to:

Lab 5 - equals(Object o)

1 of 251 articles shown, currently no other people reading this forum.
Date: Tue 7th Apr, 11:13am
> The equals method we need to implement has 
> argument o of type Object. If its anything 
> other than a binary tree the method should 
> return false. So to call Binary Tree methods 
> on o it needs to be cast to a BinaryTree so we 
> can check if it has the same structure as the 
> tree you call equals() from.

Ah, that makes sense. I forgot o was a parameter. Well, I'm still a bit confused about 
BinTree. BinTree is supposed to be a subclass of BinaryTree? I'm not sure what that's 
supposed to mean. Is it supposed to only have the methods equals and iterator?

Related articles

Lab 5 - equals(Object o) (all 9) RSS
├─ original   Sat 4th Apr, 1:33pm, Thomas C.
├─ reply 1   Sat 4th Apr, 1:41pm, Thomas C.  O.P.
├─ reply 2 confused Tue 7th Apr, 10:40am, ANONYMOUS
├─ reply 3   Tue 7th Apr, 10:54am, Thomas C.  O.P.
├─ THIS   Tue 7th Apr, 11:13am, ANONYMOUS
├─ reply 5   Tue 7th Apr, 12:21pm, Thomas C.  O.P.
├─ reply 6   Thu 9th Apr, 12:52pm, ANONYMOUS
├─ reply 7   Thu 9th Apr, 5:01pm, Thomas C.  O.P.
└─ reply 8   Thu 9th Apr, 8:07pm, ANONYMOUS
This Page

Program written by: [email protected]
Feedback welcome
Last modified:  8:27am May 24 2020