CMPT 225 Lecture Notes - Lecture 1: Include Directive, Big O Notation

129 views3 pages

Document Summary

Insertions and removals follow last in first out scheme. Pop removes and returns last inserted element. Top returns but doesn t remove top. Size returns number of elements on stack. Empty returns true if size = 0. Input: a sequence of n tokens output: true if parentheses correctly matched. ;pop a token and compare to closing just found, must match. Only need a for loop with a counter. If ends on 0 they are evenly matched. Inserts a library of declarations and functions. Print statement, left arrows for output, \n for new new line. C++ files cout << hello world \n ; Don t need a new operator to create an instance of a class in c++ Within header file int* a; creates a pointer to an array. A = new int[capacity] //will evaluate to a pointer. #include int_stack. h inserts text of the header file when complied so declarations are available, thus they only occur in one place.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents