CS140 Homework 7[10 pts]
Due 9.40am Tuesday Oct 10, 2017
Problem 1
Consider a hash table for which collisions are handled by chaining using single-linked lists. The keys are
integers. The table size is 10. The hash function is h(key) = key % 10. Det
CS140 Homework 6[10 pts]
Due 9.40am Thursday September 21, 2017
Problem 1
See the code below. Write the template based class implementation of function object neq which
compares a given data element against a target and return
CS140 Homework 2 [10 pts]
Due 9.40am Thursday September 7, 2017
Late submissions will not be accepted
Problem 1
Write single linked list class member functions push_front, pop_front and front which work just like the
back equivalents on the lis
CS140 Homework 5[10 pts]
Due 9.40am Tuesday September 19, 2017
Problem 1
Rewrite the stats class from Prog1c in Lab 1 to be template based. To make things a little easier, delete
the min-max computation. N remains an integer but all data references
CS140 Homework 4 [10 pts]
Due 9.40am Thursday September 14, 2017
Problem 1 [7]
See the stack_handout for the class definition and wrapper implementation of a stack based on a list.
Your task is to replace the wrapper implementation with code based o
CS140 Homework 3 [10 pts]
Due 9.40am Tuesday September 12, 2017
Problem 1
See list_handout.pdf for the class definition and implementation of a double linked list. Rewrite the
findnode(int index) function to perform a forward search in the first half
CS140 Homework 8[10 pts]
Due 9.40am Thursday October 12, 2017
Problem 1 [4]
Determine the big-O expression for each of the following T(N) functions:
(a) T(N) = 2N + N ( N + 3)
(b) T(N) = 5
(c) T(N) = N + log N2
(d) T(N) = N ( 2 + log N )
Probl
9/28/2017
Structure of a program - C+ Tutorials
Search:
Tutorials
C+
Information
Tutorials
Reference
Articles
Forum
Go
C+Language
Notloggedin
Structureofaprogram
register
login
Structureofaprogram
Thebestwaytolearnaprogramminglanguageisbywritingprograms.
1)
2)
3)
4)
5)
Install Debian Wheezy 7.4 this is assuming the x64 DVD iso on USB via UNetBootin
Su root
adduser * sudo
/* is your primary user account that you want to be installing shit with
logout and log back in
sudo nano /etc/apt/sources.list
a. Delet
1
Homework #3 Idan Kanter
Exercises 2.3:
Problem 4
a. P: If Janice has trouble starting her car.
Q: Then her daughter Angela will check Janices spark plug.
P is true By the rule of inference called Modus Ponens:
PQ
P
-Q
Q: Janices daughter Angela will che
Diagrams above show structured programming control structures (we assume test c does not change
state) and their corresponding verification conditions.1
Suppose functionality f is implemented as: g followed by h. That implementation is correct
provided:
1
Homework #2 Idan Kanter
Exercises 1.1 and 1.2
Problem 16
N = 40, k = 25
o Distinct messages = 4025 = 1.113x1040
o Distinct messages = 402*3023 = 1.51x1037
Problem 17
1) Begin with 0, followed by 7-bit network number, then 24-bit local address,
1 is rest
Relations, Partial Orders, Directed Graphs
Let A, B, be sets. A subset R of the Cartesian product A B is a relation from A to B. If B = A,
then R is a relation on A. An alternate notation for (a, b) R is aRb. Relation R is called:
reflexive iff x A . xRx
Kanter 1
Homework #6 Idan Kanter
y
f
C
True
g
(y+1)2 x
y := y +
1
False
x , y>
2
2
2
(
)
(
)
( y x) ( y <0 ( y +1 x ) )< x , x >( y 2 > x ) ( y 0 ) ( ( y +1 ) > x ) )< x , y>
f
g (<x, y>) = <x, y + 1>
A. Termination
B. If C is true, does g; f accomplis
Kanter 1
Homework #5 Idan Kanter
Homework block 1
1. Consider the less than or equal relation on R:
Partial Order?
o It is reflexive because every x equals itself.
o It is transitive because [( ) ( )] ( ).
o It is antisymmetric because [( ) ( )] ( = ).
o
1
is NOR, remember the head of the arrow is V same as OR symbol V
is NAND, remember the head of the arrow is same as AND symbol
A set A is a subset () of a set B if every element in set A is also an element in set B
Example: Given that A = cfw_1, 5, 7
Idan Kanter: Extra credit
1. Prove: ( ) = () ()
Let f: X Y be a one-to-one function. If .
Show:
() () ( ) by letting () (),
We have: () (); therefore,
cfw_
(1 (1 ) =
2 (2 ) =
=> (1 ) = (2 )
Since f is assumed to be 1 to 1 function, we conclude 1 = 2 , a
I glossed over a potentially confusing detail concerning the power set example.
After unraveling definitions, the goal was written as
(x) (x) (x) (x) (x) (x) (x)
The detail concerns how x should be quantified. If the quantification were made explicit, it
Idan Kanter: Extra credit
1. Prove: f ( A B )=f ( A ) f ( B)
Let f: X Y be a one-to-one function. If
A XB Y .
Show:
f ( A ) f (B) f ( A B) by letting
We have:
y f ( A ) f (B) ,
y f ( A ) y f (B) ; therefore,
x 1 A such that f ( x 1 )= y
=> f ( x 1 )=f (
10/13/2016
web.eecs.utk.edu/~bvz/cs365/hw/hw6/index.html
Homework Assignment 6
Use an ascii text editor or word processor to answer questions 1-5. Submission instructions are at the end of this
assignment.
1. Fill in the blanks for each of the following q
7/14/2016
web.eecs.utk.edu/~bvz/teaching/cs365Sp15/exams/nal/nal15-answers.html
CS365 Final Solutions - Spring 2015
The correct answers are highlighted by bold-facing them.
1. (5 points) This question refers to the MVC model. For each of following task de
7/14/2016
web.eecs.utk.edu/~bvz/teaching/cs365Sp15/exams/nal/nal15.html
CS365 Final - Spring 2015
1. This exam allows you to use a one-page "cheat" sheet that may be lled on both sides. You may not use a
computer or any electronic devices.
2. You must ans
7/14/2016
web.eecs.utk.edu/~bvz/teaching/cs365Sp15/exams/midterm/midterm.html
CS365 Midterm - Spring 2015
1. You may use a one page front-and-back "cheat" sheet for this exam. You may not use a computer or any
electronic devices.
2. You must answer all of