ITI 1121 Final: ITI 1121 University of Ottawa 2005 Final Exam-en

24 views28 pages

Document Summary

Question 1: short-answer questions (20 marks: the algorithm seen in class for evaluating post x (rpn) expressions is using a stack or a queue as its main data structure? (2 marks, complete the table below. Consider the general cases only (not the speci c cases). (4 marks) Doubly linked with a tail pointer addlast( object o ) removelast( object o : convert the following unsigned decimal to binary. (4 marks) ( 101. 3125 )10 = ( )2: add the following two unsigned binary numbers. (4 marks) Page 3 of 28: correct the three (commonly occurring) mistakes in the implementation of the method add below. Elem p = head; for ( int i = 0; i < ( pos-1 ); i++ ) { p++; p = new elem( obj, p. next ); This question is about the queue abstract data type (adt). Its interface is de ned as follows. public interface queue { /** returns true if this queue has no elements.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents