

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Main points of this past exam are: Recursive Calls, More Efficient, Data Structures, Running Time, Syntax Errors, Binary Tree, Rooted at Node
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!
public LinkList reverse() { Link current = this .first; LinkList rev = new LinkList(); while (current != null ) { Link node = new Link(current.data); node.next = rev.first; rev.first = node; current = current.next; } return rev; }
public static int size(Node x) { if (x == null ) return Stack
Node x) { 0; new Stack
!= null ) { rightChild != null ) { stack.push(x.rightChild leftChild;
rightChild != null ) x = x.rightChild; (!stack.isEmpty()) x = stack.pop();
The running time is O(n).
rightChild); }