Professional Documents
Culture Documents
ECE391: Computer System Engineering Homework 2 - chap 5: f (n) is Θ (log f (n) ) if b >1
ECE391: Computer System Engineering Homework 2 - chap 5: f (n) is Θ (log f (n) ) if b >1
Engineering
Homework 2 – chap 5
n
∑ i2 is O( n3 )
1. Show that i=1
n
∑ i /2i <2
2. Show that i=1
Class Ticket {
public:
string name;
string ID;
unsigned int birthyear;
}
a). Write a constructor for the class Ticket to assign the default values for name, ID, and
birthyear.
queue<Ticket> Waiting_list;
c). Write a function to add a person with the following information into the Waiting list:
string my_name = “Nguyen Van A”;
string my_ID= “0010”;
unsigned int my_birthyear = 1990;
d). Write a function to get the information of a person at the front of the Waiting_list.