[Hilo Oficial] Esto también es otro arte...el ARTE de programar
Cita
En english:

Cita:Given class below:

Código:
private readonly float rating;
   private List<Movie> similarMovies; // Similarity is bidirectional

   public Movie(char movieId, float rating)
   {
       this.movieId = movieId;
       this.rating = rating;
       similarMovies = new List<Movie>();
   }

   public char getId()
   {
       return movieId;
   }

   public float getRating()
   {
       return rating;
   }

   public void addSimilarMovie(Movie movie)
   {
       similarMovies.Add(movie);
       movie.similarMovies.Add(this);
   }

   public List<Movie> getSimilarMovies()
   {
       return similarMovies;
   }    

   public static IList<Movie> getMovieRecommendations(Movie movie, int numTopRatedSimilarMovies)
   {
       //Implement this method        
       return null;
   }
}
reachable from the current movie
        eg:            A(Rating 1.2)
                       /   \
                    B(2.4)  C(3.6)
                      \     /
                       D(4.8)


In the above example edges represent similarity and the number is rating. getMovieRecommendations(A,2)should return C and D (sorting order doesn't matter so it can also return D and C) getMovieRecommendations(A,4) should return A, B, C, D (it can also return these in any order eg: B,C,D,A) getMovieRecommendations(A,1) should return D. Note distance from A to D doesn't matter
(Ultima edición: 01-12-2016 20:31 por xecollons.)


Mensajes en este tema
Re:Esto también es otro arte...el ARTE de programar - por Juntacadaveres - 25-10-2012 15:34
Re:Esto también es otro arte...el ARTE de programar - por Corona Radiata - 27-10-2012 03:00
RE: Esto también es otro arte...el ARTE de programar - por xecollons - 01-12-2016 20:30
Re:Esto también es otro arte...el ARTE de programar - por Juntacadaveres - 24-10-2012 16:47

Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)