Lab3

(Part I) Hacker Rank Contest (100 puntos)

https://www.hackerrank.com/unal-algorithms-lab-3-2018-ii-gr-1-and-gr2


  • HackerRank and Hackerearth reading an array of size n in Python, C and C++ - Github
  • Merge Sort - Geeksforgeeks


  • Competitive Programmer's Handbook PDF (long long) - Code Submission Evaluation System Finland - CSES
  • Common mistakes to be avoided in Competitive Programming in C++ | Beginners - Geeksforgeeks


  • Python - Most frequent problem for beginners (on Hackerearth) - Rishikesh Agrawani - Linkedin
  • Anuj Saharan HackerRank Arrays-DS.cpp - Github
  • <bits/stdc++.h> in C++ - Geeksforgeeks


(Part II) Analysis Overleaf(100 puntos)

Assume that A is an array of size n of distinct elements

  • Minimum number of inversions - instance
  • Maximum number of inversions - instance
  • Complexity (worst case number of comparisons) of the brute force counting on A
  • Complexity (worst case number of comparisons) of the divide an conquer (mergesort) counting on A
  • Run in your local machine the brute force and divide and conquer algorithms in Python 2.7 and calculate the time for the first 10^5 numbers of size instance from Hackearth input and output and for the 10^5 sorted increasing and decreasing numbers.
  • Run your local machine the brute force and divide and conquer algorithms in C or C++ calculate the time for tthe first 10^5 numbers of size instance from Hackearth input and output and for the 10^5 sorted increasing and decreasing numbers.
  • Using PythonTeX on Overleaf - LaTeX Example on Overleaf