Bubble sort is O(n) at best, O(n^2) at worst, and its memory usage is O(1) . Merge sort is always O(n log n), but its memory usage is O(n). Explain which algorithm you would use to implement a function that takes an array of integers and returns the max integer in the collection, assuming that the length of the array is less than 1000. What if the array length is greater than 1000?
2)You've always been intrigued with the Six Degrees of Kevin Bacon game. Now, let's say if two actors have been in the same movie we call them 'friends' and if two actors have not been in the same movie, we say they are not 'friends'. Now choose any two actors at random -- we want to calculate the number of degrees of separation and the path between them. How do you go about this problem? Discuss ideas, trade-offs, algorithm ideas, and more.
3)Your best friend Betty thinks IMDB is too complicated and challenges you to create a simple movie web site. One page will display movies (with movie name, date it was released, and list of actors). Click on an actor and you're taken to the actor page (with actor name, birthday, bio, and list of movies actor has been in). Please outline the relational table structure of the database for this.
create table Movie(Name varchchar, Date date, primary key ID identifying);
create table Actor (Name varchar, birtday date, bio varchar, primary key ID identifying);
create table MovieActor(MovieID integer references Movie, ActorID integer references Actor ) Primary key (MovieID , ActorID);
4)If you roll 5 standard six-sided dice, what's the probability that you get at least three 2s?