Skip to content

Instantly share code, notes, and snippets.

@mariusmg2
Last active November 12, 2018 06:53
Show Gist options
  • Select an option

  • Save mariusmg2/d015aaff19f967030796d1f48c369afb to your computer and use it in GitHub Desktop.

Select an option

Save mariusmg2/d015aaff19f967030796d1f48c369afb to your computer and use it in GitHub Desktop.

Revisions

  1. mariusmg2 revised this gist Nov 12, 2018. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  2. mariusmg2 created this gist Nov 12, 2018.
    4 changes: 4 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    Sa se citeasca un numar natural N, urmat de un sir de N numere naturale.
    Se cere afisarea acelor numere care se repeta de cel putin o data (+ de cate ori se repeta).

    Ex: N: 7, sir: [4, 6, 3, 4, 2, 2, 0], Rezultat: 4->2, 2->2.
    11 changes: 11 additions & 0 deletions gistfile2.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    Sa se citeasca un numar natural N, urmat de un sir de N numere naturale.
    Se cere implementarea unui algoritm de sortare, si sortarea sirului citit crescator sau descrescator, in functie de metoda selectata de utilizator.

    Ex: N: 14, sir: 1, 2, 4, 3, 6, 5, 8, 7, 0, 9, 3, 4, 5.
    Pentru optiunea aleasa "crescator" (string) se va afisa: 0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9.
    Pentru optiunea aleasa "descrescator" (string) se va afisa: 9, 8, 7, 6, 5, 5, 4, 4, 3, 3, 2, 1, 0.

    /**
    * Despre algoritmi de sortare: https://brilliant.org/wiki/sorting-algorithms/
    * Exempu de algoritm "Bubble Sort" implementat in Java: http://www.java2novice.com/java-sorting-algorithms/bubble-sort/
    */