CS570 (Spring 2015) Quiz 16
Question 1 (1.5 points) For homework 9, in analyzing Treap, we define Xik =
Icfw_y is in the right spline of the left subtree of x, where k = x.key and i = y.key.
Give a characterization of Iik = 1 in terms of the attributes (k
CS570 Spring 2015 (HW 6 Answers)
Hing Leung
Question 1
When a function f is convex, Jensens inequality states that E[f (X)] f (E[X]) where X
is a random variable. Let the random variable outcomes be x1 , x2 , . . . , xn . Let x
= E[X] =
(x1 + x2 + . . .
1
CS 570 (Spring 2017) Quiz Answers
Hing Leung
(Jan 25)
The following eight questions (a)(h) are equally weighted for 0.5 point each.
(a) Name a sorting algorithm which average case running time is (n lg n)
and worst case running time is (n2 ). (b) What
1
CS 570 (Spring 2014) Mid Term Exam
Hing Leung
1. (2%+3%+10%)
(a) Consider multiplying two numbers of k and j bits each using the grade
school (elementary school) multiplication algorithm. What is the running
time in Theta notation in terms of k and j? (
CS570 Spring 2015 (HW 8 Answers)
Hing Leung
Problem 92
(a) Let m be the median of the n numbers. The number of data smaller (respectively, greater) than m is at most bn/2c. Thus the total weight for data smaller
(respectively, greater) than m is at most
CS570 Spring 2015 (HW 4 Answers)
Hing Leung
Problem 73
(a) For RANDOMIZEDQUICKSORT, we make a call to RANDOM(p, r) which returns
any integer i between p and r with equal probability. We next choose A[i] as the pivot,
which can be any one of the n elemen
CS570 Spring 2015 (HW 7 Answers)
Hing Leung
Problem 94
(a)
Case 1: Suppose 1 i < j < k.
Among zi , zi+1 , . . . , zk , if zi or zj is chosen as pivot first, then zi and zj are
compared; otherwise, zi and zj will never be compared. Therefore, E[Xijk ] =
2

Laura Sadler @LauraSadler2 Hudson's team manager Justin Forrest stole the show Friday night!
Autism doesn't define him, but his spirit does:

Our staff will be wearing these pins for Autism Speaks! Please visit autismspeaks.org for
more information.

97832
AUT18810.1177/1362361313497832AutismKuo et al.
Article
Media use among adolescents with
autism spectrum disorder
Autism
2014, Vol. 18(8) 914923
The Author(s) 2013
Reprints and permissions:
sagepub.co.uk/journalsPermissions.nav
DOI: 10.1177/13623613
Discovering Shifts to Suicidal Ideation
from Mental Health Content in Social Media
Munmun De Choudhury
Georgia Tech
Atlanta GA 30332
[email protected]
Emre Kiciman
Microsoft Research
Redmond WA 98052
[email protected]
Glen Coppersmith
Qntfy.io
Crownsvi
1
CS 570 (Spring 2017) Note 1
Hing Leung
We define Fibonacci numbers as fib(0) = 0, fib(1) = 1, and fib(n) =
fib(n 1) + fib(n 2) for n 2. The sequence of Fibonacci numbers
is 0,1,1,2,3,5,8,13,21,34,55,89,., which is known to grow exponentially fast.
Task
1
CS 570 Spring 2015 (HW 10 Answers)
Hing Leung
Ex 14.37
/ determines if two rectangles in S overlaps
RectanglesIntersect( S ) cfw_
initialize an empty redblack tree T
/ T maintains a set of rectangles ordered by the minimum ycoordinates
sort the endp
CS570 Spring 2015 (HW 9 Answers)
Hing Leung
Problem 134
(a) From the discussion in the problem (insert the elements into an initially empty
binary search tree in the order given by the priorities), it is clear that there is
only a unique treap obtained.
CS570 Spring 2014 (Note 15)
Hing Leung
Average Case Analysis of Bucket Sort
Let Zi be the random variable that denotes the bucket number that the ith data falls into.
We define the indicator random varible Xk,i =def (Zi = k).
We define the indicator rand
CS 570 (Spring 2010)
Note 3
Hing Leung
Consider the recurrence T such that
T (n) = aT (n/b) + f (n)
where a 1 and b > 1.
First, lets focus our attentions to those values of n that are powers of b,
that is, n = bk for some positive integer k. Then
T (bk )
#include <stdio.h>
#include <stdlib.h>
#define inf
#define n
99999999
5
#define undef 99999999
/ Dynamic Programming using memoization technique
int min(int x, int y) cfw_return y > x ? x : y;
int add(int x, int y) cfw_return x=inf  y=inf ? inf : x+y;
i
CS570 Spring 2015 (HW 11 Answers)
Hing Leung
Ex 16.26
Assume that we have n items; the ith item is worth vi dollars and weighs wi pounds.
Also assume that the thief can only take W pounds with him. Let SP= cfw_x1 , x2 , . . . , xn
n
where xi = wi /vi f
1
CS 570 (Spring 2015) Final Exam
Hing Leung
1. (3%+3%+4%+6%+4%) In the answer to HW12, we explained how to generate a
code for a full binary tree.
This is done by making a preorder traversal of the tree. For every node visited,
print out a 0 or a 1 depen
(1)
show that lg n! = Theta(n lg n)
Consider log to the base 2, which we denote as lg.
n!
= 1*2*3*.*n
<= n*n*n*.*n
= n^n
Thus, lg n! <= lg (n^n) = n lg n
When n is even,
n!
= 1*2*3*.*(n/2  1)*(n/2)*(n/2 + 1)*(n/2 + 2)*.n
>=
(n/2)*(n/2 + 1)*(n/2 + 2)*.n
>
1
CS 470 (Fall 1993)
Solution to homework 2
Solve for the recurrence T such that T (2) = 0 and
T (n) = T (d ne) + lg n f or n > 2
k
First, let n = 22 where k 1. Then
k
T (22 ) = T (22
k1
0
) + 2k = . . . = T (22 ) +
k
X
2i = 2k+1 2
i=1
k
Thus, T (n) = 2 l
1
CS 572 (Fall 2013)
Supplementary Notes on Greedy Algorithms
Minimum cost spanning tree
Ref: Chapter 23
Let G = (V, E, w) be a connected graph with edge costs where V is a set of
S
nodes, E is a set of edges and w : E IR+ cfw_0 is a cost function.
Greedy
Multimodal Classification of Moderated Online
ProEating Disorder Content
Stevie Chancellor
Georgia Tech
Atlanta, GA USA
[email protected]
Yannis Kalantidis
Yahoo Research
San Francisco, CA USA
[email protected]
Munmun De Choudhury
Georgia Tech
#294
Social Media Utilization in the Autism Community
B. Romero , M. Choudhury
1
1
Department of Special Education/Communication Disorders, New Mexico State University, Las Cruces, NM, USA
1
Introduction:
Forums
100%
11
90%
Blogs
Autism spectrum disorder
#include <iostream>
#include <vector>
using namespace std;
int main()
cfw_
int empID[]=cfw_23,988,72, 64, 539, 17, 22,1,48,65,9,47,1;
int id;
cout < "Enter employee id: ? ";
cin > id;
int flag = 0; /Variable used to record the search status
for(int i = 0
4) Explain the dynamics the short circuit mechanism involving the logical AND
operator.
How would such a mechanism be useful in the following code (10 pts):
int val;
cin > val;
if(val >= 0 & sqrt(val) > 10 )
cout < "A good value";
Answer:
Short circuit is
Lab Functions
For the following lab, make one program that does all of the functions listed. You should call each function to ensure it operates correctly. For the problems that require arguments, prompt the user for the appropriate input, and pass the va
/ Online store (Mulitple Orders) assignment
/ This program handles is an update for the Online Store (One order)
/ The two addidions we have made. The first is two more states Pennsylvania and
West Virginia
/ The second is an infinite loop until the usser