[Question]
  [
The sorting algorithm goes like this:
While the list is not sorted, snap half of all items (remove them from the list). Continue until the list is sorted or only one item remains (which is sorted by default). This sorting algorithm may give different results based on implementation.
The item removal procedure is up to the implementation to decide, but the list should be half as long as before after one pass of the item removal procedure. Your algorithm may decide to remove either the first half or the list, the last half of the list, all odd items, all even items, one at a time until the list is half as long, or any not mentioned. 
The input list can contain an arbitrary amount of items (within reason, let’s say up to 1000 items), not only perfectly divisible lists of 2^n items. You will have to either remove (n+1)/2 or (n-1)/2 items if the list is odd, either hardcoded or decided randomly during runtime. Decide for yourself: what would Thanos do if the universe contained an odd amount of living things?
The list is sorted if no item is smaller than any previous item. Duplicates may occur in the input, and may occur in the output.
Your program should take in an array of integers (via stdin or as parameters, either individual items or an array parameter), and return the sorted array (or print it to stdout).
Examples:
```
// A sorted list remains sorted
[1, 2, 3, 4, 5] -> [1, 2, 3, 4, 5]
// A list with duplicates may keep duplicates in the result
[1, 2, 3, 4, 3] -> [1, 3, 3] // Removing every second item
[1, 2, 3, 4, 3] -> [3, 4, 3] -> [4, 3] -> [3] // Removing the first half
[1, 2, 3, 4, 3] -> [1, 2] // Removing the last half
```
`[1, 2, 4, 3, 5]` could give different results:
```
// Removing every second item:
[1, 2, 4, 3, 5] -> [1, 4, 5]
```
or:
```
// Removing the first half of the list
[1, 2, 4, 3, 5] -> [3, 5] // With (n+1)/2 items removed
[1, 2, 4, 3, 5] -> [4, 3, 5] -> [3, 5] // With (n-1)/2 items removed
```
or:
```
// Removing the last half of the list
[1, 2, 4, 3, 5] -> [1, 2] // With (n+1)/2 items removed
[1, 2, 4, 3, 5] -> [1, 2, 4] // With (n-1)/2 items removed
```
or:
```
// Taking random items away until half (in this case (n-1)/2) of the items remain
[1, 2, 4, 3, 5] -> [1, 4, 3] -> [4, 3] -> [4]
```
  
[Answer]
# [Python 3](https://docs.python.org/3/), ~~38~~ ~~42~~ 39 bytes
```
q=lambda t:t>sorted(t)and q(t[::2])or t
```
[Try it online!](https://tio.run/##K6gsycjPM/7/v9A2JzE3KSVRocSqxK44v6gkNUWjRDMxL0WhUKMk2srKKFYzv0ih5H9BUWZeiUahRrShjpGOcaymJhdcxBgoYggU@Q8A "Python 3 – Try It Online")
`-3 bytes` thanks to @JoKing and @Quuxplusone
[Answer]
# [R](https://www.r-project.org/), 41 bytes
```
x=scan();while(any(x-sort(x)))x=x[!0:1];x
```
[Try it online!](https://tio.run/##K/r/v8K2ODkxT0PTujwjMydVIzGvUqNCtzi/qESjQlNTs8K2IlrRwMow1rriv6GCkYKJgrGC6X8A "R – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 39 bytes
```
f=lambda l:l>sorted(l)and f(l[::2])or l
```
[Try it online!](https://tio.run/##Vcm7CoAgFADQva@4Y8JdfC1C/Yg4GCYFNxVz6evNsdZzytOOnETvcSF/bcEDGVrvXNseZmI@BYgzWWOEY7kC9VLP1IZZjiAQFIJE0I5NnxAoUeEP9QA5gjvWXw "Python 2 – Try It Online")
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog) (v2), 6 bytes
```
≤₁|ḍt↰
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r//1HnkkdNjTUPd/SWPGrb8P9/tKGOkY6JjrGOaez/KAA "Brachylog – Try It Online")
This is a function submission. Input from the left, output to the right, as usual. (The TIO link uses a command-line argument that automatically wraps the function into a full program, so that you can see it in action.)
## Explanation
```
≤₁|ḍt↰
≤₁       Assert that {the input} is sorted {and output it}
  |      Handler for exceptions (e.g. assertion failures):
   ḍ     Split the list into two halves (as evenly as possible)
    t    Take the last (i.e. second) half
     ↰   Recurse {and output the result of the recursion}
```
## Bonus round
```
≤₁|⊇ᵇlᵍḍhtṛ↰
```
[Try it online!](https://tio.run/##ATcAyP9icmFjaHlsb2cy///iiaTigoF84oqH4bWHbOG1jeG4jWh04bmb4oaw//9bMSwyLDQsMyw1Xf9a "Brachylog – Try It Online")
The snap's meant to be random, isn't it? Here's a version of the program that choses the surviving elements randomly (while ensuring that half survive at each round).
```
≤₁|⊇ᵇlᵍḍhtṛ↰
≤₁            Assert that {the input} is sorted {and output it}
  |           Handler for exceptions (e.g. assertion failures):
   ⊇ᵇ         Find all subsets of the input (preserving order)
     lᵍ       Group them by length
       ḍht    Find the group with median length:
         t      last element of
        h       first
       ḍ        half (split so that the first half is larger)
          ṛ   Pick a random subset from that group
           ↰  Recurse
```
This would be rather shorter if we could reorder the elements, but whyever would a sorting algorithm want to do *that*?
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 30 bytes
```
$!={[<=]($_)??$_!!.[^*/2].&$!}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYKvwX0XRtjraxjZWQyVe095eJV5RUS86TkvfKFZPTUWx9n9xYqVCmkK0oY6CkY6CsY6CiY6Caaw1FxZhY3RhE7CMaex/AA "Perl 6 – Try It Online")
Recursive function that removes the second half of the list until the list is sorted.
### Explanation:
```
$!={                         }    # Assign the function to $!
    [<=]($_)??                    # If the input is sorted
              $_                  # Return the input
                !!                # Else
                  .[^*/2]         # Take the first half of the list (rounding up)
                         .&$!     # And apply the function again
```
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 76 bytes
```
g=>{while(!g.OrderBy(x=>x).SequenceEqual(g))g=g.Take(g.Count()/2);return g;}
```
[Try it online!](https://tio.run/##XY3RasIwFEDf/YrYp1x6jdipDGoCOhQEYQ8b7DntrtewLmKaYIf02@vm4@A8HTicup3UrRt2yder/danbwq2amjlfDT4Xxhx1ANrc7ueXENyzOo1fFLY/MhOmw7UG10S@Zq2l2QbyQCsWb3bL5KsXs7JRwnTAspAMQUvuOyHcjT6CC6SPEpPV3FwbXycbjMs8BnF/METigUu8c/NelBr5kBsf6ssQ2mxAm1snoksrwDK4Q4 "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# Java 10, ~~106~~ 97 bytes
```
L->{for(;;L=L.subList(0,L.size()/2)){int p=1<<31,f=1;for(int i:L)f=p>(p=i)?0:f;if(f>0)return L;}}
```
-9 bytes thanks to *@OlivierGrégoire*.
[Try it online.](https://tio.run/##tZFNb8MgDIbv/RUcQXJY0g81LU2mHSexXnqcdqApVHQpjYB06qr89oxknTRN2i0FhMDG72ObgziL6LB7b4tSOIdehDbXEULaeGmVKCRad1eEDuEdrb0uKdfOr56Dfy9tjgr8n4cTFiKbUdicF14XaI0Myloe5Vd1spgxnnHq6m0XhmMIZ/0pMXkYE3INfFRlyWo1SUBlCesCOptecqKyKsdVpsljvFRMK6zymFjpa2sQZ03Tso5Z1dsyMG/o80nv0DEUhzfearN/fUOCfFe2uTgvj/RUe1oFly8NNrTARn78KvrJWnHpE/1jc1S43p7AGCYwhRkJgw2tPA3awytPIR1cM4UouUOis9CEFIZXnkA/B9ed9V82vkPGURJDWNECFhCloSnRHOZ3ofT68xus4/xQmlHTfgE)
Only leave the first halve of the list every iteration, and removes \$\frac{n+1}{2}\$ items if the list-size is odd.
**Explanation:**
```
L->{               // Method with Integer-list as both parameter and return-type
  for(;;           //  Loop indefinitely:
      L=L.subList(0,L.size()/2)){
                   //    After every iteration: only leave halve the numbers in the list
    int p=1<<31,   //   Previous integer, starting at -2147483648
        f=1;       //   Flag-integer, starting at 1
    for(int i:L)   //   Inner loop over the integer in the list:
      f=p>(p=i)?   //    If `a>b` in a pair of integers `a,b`:
         0         //     Set the flag to 0
        :          //    Else (`a<=b`):
         f;        //     Leave the flag the same
    if(f>0)        //   If the flag is still 1 after the loop:
      return L;}}  //    Return the list as result
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 30 bytes
```
#//.x_/;Sort@x!=x:>x[[;;;;2]]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n277X1lfX68iXt86OL@oxKFC0bbCyq4iOtoaCIxiY9X@BxRl5pUoOASWZqaWOCikR1cb6igY6SiY6CgY6yiY1sb@/w8A "Wolfram Language (Mathematica) – Try It Online")
@Doorknob saved 12 bytes
[Answer]
# JavaScript (ES6), ~~49~~ 48 bytes
*Saved 1 byte thanks to @tsh*
Removes every 2nd element.
```
f=a=>a.some(p=c=>p>(p=c))?f(a.filter(_=>a^=1)):a
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/zTbR1i5Rrzg/N1WjwDbZ1q7ADkRratqnaSTqpWXmlKQWacQDlcTZGmpqWiX@T87PK87PSdXLyU/XSNOINtQx0jHWMdExjdXU5MIiZwKUxSYH0mUI1fcfAA "JavaScript (Node.js) – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), 37 bytes
```
->r{r=r[0,r.size/2]while r.sort!=r;r}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf166ousi2KNpAp0ivOLMqVd8otjwjMydVAcjNLypRtC2yLqr9X6CQFh1tqGOkY6JjrGMaG8sFFzAGCsEFTMHyRjqGsbH/AQ "Ruby – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~8~~ 7 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
[Ð{Q#ιн
```
-1 byte thanks to *@Emigna*.
Removes all odd 0-indexed items every iteration, so removes \$\frac{n-1}{2}\$ items if the list-size is odd.
[Try it online](https://tio.run/##yy9OTMpM/f8/@vCE6kDlczsv7AWyDXUUjHQUTHQUjHUUTGMB) or [verify some more test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/6MMTqgOVz@28sPd/rc7/6GhDHSMdYx0THdNYHQUwxwTIBXNMdCxAlIWOriGEawqUtdABc4x1wBDENAXrMIKI6xoa6ACRrqWOpY6uBVC1rrmOOUwCLGQOlQdJxcYCAA) (or [verify those test cases with step-by-step for each iteration](https://tio.run/##yy9OTMpM/V@m5JlXUFpipaBkX@mio@RfWgLkKZRnlmQoFJekFhQDJXT@Rx@eUB2ofG6n7YW9/2t1Dm2z/x8dbahjpGOsY6JjGqujAOaYALlgjomOBYiy0NE1hHBNgbIWOmCOsQ4YgpimYB1GEHFdQwMdINK11LHU0bUAqtY11zGHSYCFzKHyIKnYWAA)).
**7 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage) alternative by *@Grimy***:
```
ΔÐ{Ê>äн
```
Removes the last \$\frac{n}{2}\$ items (or \$\frac{n-1}{2}\$ items if the list-size is odd) every iteration.
[Try it online](https://tio.run/##yy9OTMpM/f//3JTDE6oPd9kdXnJh7///0YY6CkY6CiY6CsY6CqaxAA) or [verify some more test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/c1MOT6g@3GV3eMmFvf9rdf5HRxvqGOkY65jomMbqKIA5JkAumGOiYwGiLHR0DSFcU6CshQ6YY6wDhiCmKViHEURc19BAB4h0LXUsdXQtgKp1zXXMYRJgIXOoPEgqNhYA) (or [verify those test cases with step-by-step for each iteration](https://tio.run/##yy9OTMpM/V@m5JlXUFpipaBkX@mio@RfWgLkKZRnlmQoFJekFhQDJXT@n5tyeEL14S67w0tsL@z9X6tzaJv9/@hoQx0jHWMdEx3TWB0FMMcEyAVzTHQsQJSFjq4hhGsKlLXQAXOMdcAQxDQF6zCCiOsaGugAka6ljqWOrgVQta65jjlMAixkDpUHScXGAgA)).
**Explanation:**
```
[        # Start an infinite loop:
 Ð       #  Triplicate the list (which is the implicit input-list in the first iteration)
  {Q     #  Sort a copy, and check if they are equal
    #    #   If it is: Stop the infinite loop (and output the result implicitly)
  ι      #  Uninterweave: halve the list into two parts; first containing all even-indexed
         #  items, second containing all odd-indexed items (0-indexed)
         #   i.e. [4,5,2,8,1] → [[4,2,1],[5,8]]
   н     #  And only leave the first part
Δ        # Loop until the result no longer changes:
 Ð       #  Triplicate the list (which is the implicit input-list in the first iteration)
  {Ê     #  Sort a copy, and check if they are NOT equal (1 if truthy; 0 if falsey)
    >    #  Increase this by 1 (so 1 if the list is sorted; 2 if it isn't sorted)
     ä   #  Split the list in that many parts
      н  #  And only leave the first part
         # (and output the result implicitly after it no longer changes)
```
[Answer]
# TI-BASIC (TI-84), ~~47~~ ~~42~~ ~~45~~ 44 bytes
*-1 byte thanks to @SolomonUcko!*
```
Ans→L1:Ans→L2:SortA(L1:While max(L1≠Ans:iPart(.5dim(Ans→dim(L2:L2→L1:SortA(L1:End:Ans
```
Input list is in `Ans`.  
Output is in `Ans` and is implicitly printed out.
**Explanation:**
```
Ans→L1                  ;store the input into two lists
Ans→L2
SortA(L1                ;sort the first list
                        ; two lists are needed because "SortA(" edits the list it sorts
While max(L1≠Ans        ;loop until both lists are strictly equal
iPart(.5dim(Ans→dim(L2  ;remove the latter half of the second list
                        ; removes (n+1)/2 elements if list has an odd length
L2→L1                   ;store the new list into the first list (updates "Ans")
SortA(L1                ;sort the first list
End
Ans                     ;implicitly output the list when the loop ends
```
---
**Note:** TI-BASIC is a tokenized language. Character count does *not* equal byte count.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
m2$⁻Ṣ$¿
```
[Try it online!](https://tio.run/##ASwA0/9qZWxsef//bTIk4oG74bmiJMK//8OHxZLhuZj//1sxLCAyLCA0LCAzLCA1XQ "Jelly – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), ~~57~~ 55 bytes (thanks to ASCII-only)
```
f x|or$zipWith(>)x$tail x=f$take(div(length x)2)x|1>0=x
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P02hoia/SKUqsyA8syRDw06zQqUkMTNHocI2DcjITtVIySzTyEnNSy/JUKjQNNKsqDG0M7Ct@J@bmJmnYKuQkq9QUFoSXFLkk6egolCckV8OpNIUog11jHRMdIx1TGO5FOAAp0pjoFrCKk3BJhrpGMb@BwA "Haskell – Try It Online")
---
Original Code:
```
f x|or$zipWith(>)x(tail x)=f(take(div(length x)2)x)|1>0=x
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P02hoia/SKUqsyA8syRDw06zQqMkMTNHoULTNg3Iyk7VSMks08hJzUsvyQAKGmlWaNYY2hnYVvzPTczMU7BVSMlXKCgtCS4p8slTUFEozsgvB1JpCtGGOkY6JjrGOqaxXApwgFOlMVAtYZWmYBONdAxj/wMA "Haskell – Try It Online")
---
Ungolfed:
```
f xs | sorted xs = f (halve xs)
     | otherwise = xs
sorted xs = or (zipWith (>) xs (tail xs))
halve xs = take (length xs `div` 2) xs
```
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), ~~9~~ 8 bytes
```
eo₌⟨2%⟩↻
```
[Try it online!](https://tio.run/##S0/MTPz/PzX/UVPPo/krjFQfzV/5qG33///RhgpGCsYKJgrGsQA "Gaia – Try It Online")
Explanation:
```
e		| eval input as a list
       ↻	| until
 o		| the list is sorted
  ₌		| push additional copy
   ⟨2%⟩  	| and take every 2nd element
```
[Answer]
# [Julia 1.0](http://julialang.org/), 30 bytes
```
-x=x>sort(x) ? -x[1:2:end] : x
```
[Try it online!](https://tio.run/##yyrNyUw0rPj/X7fCtsKuOL@oRKNCU8FeQbci2tDKyCo1LyVWwUqh4n9BUWZeSU6ehm60oY6RjrGOSawmF7IYRBRIo4kb6xjFav4HAA "Julia 1.0 – Try It Online")
Takes every second element of the array if not sorted.
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 49 bytes
```
l=input('');while(~issorted(l))l=l(1:2:end);end;l
```
[Try it online!](https://tio.run/##y08uSSxL/f8/xzYzr6C0RENdXdO6PCMzJ1WjLrO4OL@oJDVFI0dTM8c2R8PQysgqNS9F0xpIWOf8/x9tqGCkYKxgpmCuYBQLAA "Octave – Try It Online") This was a journey where more boring is better. Note the two much more interesting entries below:
### 50 bytes
```
function l=q(l)if(~issorted(l))l=q(l(1:2:end));end
```
[Try it online!](https://tio.run/##y08uSSxL/f8/rTQvuSQzP08hx7ZQI0czM02jLrO4OL@oJDUFyNUEi2oYWhlZpealaGpaA8n/QMzFVagRbapgqGAYq/kfAA "Octave – Try It Online") Instead of the uninteresting imperative solution, we can do a recursive solution, for only one additional byte.
### 53 bytes
```
f(f=@(g)@(l){l,@()g(g)(l(1:2:end))}{2-issorted(l)}())
```
[Try it online!](https://tio.run/##y08uSSxL/V9oq6en9z9NI83WQSNd00EjR7M6R8dBQzMdyNPI0TC0MrJKzUvR1KytNtLNLC7OLypJTQEqqtXQ1PxfqBFtqGCkYKxgomAaq/kfAA "Octave – Try It Online") Yep. A recursive anonymous function, thanks to @ceilingcat's [brilliant answer](https://codegolf.stackexchange.com/a/164483/32352) on my [tips](/questions/tagged/tips "show questions tagged 'tips'") question. An anonymous function that returns a recursive anonymous function by defining itself in its argument list. I like anonymous functions. Mmmmm.
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), ~~22~~ 20 bytes
**Solution:**
```
{(*2 0N#x;x)x~x@<x}/
```
[Try it online!](https://tio.run/##y9bNz/7/v1pDy0jBwE@5wrpCs6KuwsGmolbfUsEQBP//BwA "K (oK) – Try It Online")
Iterate over the input until it's sorted... if it's not sorted take first n/2 items.
```
{(*2 0N#x;x)x~x@<x}/ / the solution
{                 }/ / lambda that iterates
                <x   / indices that sort x ascending (<)
              x@     / apply (@) these indices back to x
            x~       / matches (~) x? returns 0 or 1
 (       ; )         / 2-item list which we index into
          x          / original input (ie if list was sorted)
       #x            / reshape (#) x
   2 0N              / as 2 rows
  *                  / take the first one      
```
**Edits:**
* **-2** bytes thanks to ngn
[Answer]
# [MATL](https://github.com/lmendo/MATL), 11 bytes
```
tv`1L)ttS-a
```
[Try it online!](https://tio.run/##y00syfn/v6QswdBHs6QkWDfx//9oQx0FIx0FYx0FEx0F01gA "MATL – Try It Online")
This works by removing every second item.
### Explanation
```
t      % Take a row vector as input (implicit). Duplicate
v      % Vertically concatenate the two copies of the row vector. When read with
       % linear indexing (down, then across), this effectively repeats each entry
`      % Do...while
  1L)  %   Keep only odd-indexed entries (1-based, linear indexing)
  t    %   Duplicate. This will leave a copy for the next iteration
  tS   %   Duplicate, sort
  -a   %   True if the two arrays differ in any entry
       % End (implicit). A new iteration starts if the top of the stack is true
       % Display (implicit). Prints the array that is left on the stack
```
[Answer]
# [Java (JDK)](http://jdk.java.net/), 102 bytes
```
n->{for(;n.stream().reduce((1<<31)+0d,(a,b)->a==.5|b<a?.5:b)==.5;n=n.subList(0,n.size()/2));return n;}
```
There's already a C# answer, so I decided to try my hand on a Java answer.
[Try it online!](https://tio.run/##tZPPb8IgFMfv/hUcIQNm1UY3WpclOzovHpcdaMEFV6kB6uJc//butWq2LNnNkgfh1/t@3nuEjdxLtlHvTV5I79GzNPY4QMjYoN1a5hot2yVCG7jHq2AKvjA@JE9llRV6jnL8z8GCCPCrBzD4IIPJ0RJZlDaWzY/r0mFhuQ9Oyy0m3GlV5RrjKEnGEbkZKoolzQibyzTl8VeWyAce32ekXQmbgmeVtTA8pDA3nxqT2xEhwulQOYusqBvRgncQCoDP/H1pFNpCfngVnLFvL69IklNyq4MPesvLKvAdHIXCYstzbPXHr7wfnZOHDvtnz3Ppu/1I0ZGiY0UnisaKQBPXl590hB7kQXh2fdWZoizqJdi4Kwfo9yA/7orc2dW148sbjnoJnUXwf9rO7hQFY7OuSGyq6LQn2pky/eGegBdaPaibbw "Java (JDK) – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~6~~ 5 bytes
*1 byte saved thanks to Zgarb*
```
ΩΛ<Ċ2
```
[Try it online!](https://tio.run/##yygtzv7//9zKc7NtjnQZ/f//P9pQx0jHRMdYxzQWAA "Husk – Try It Online")
### Explanation
```
ΩΛ<Ċ2
Ω         Repeat until
 Λ<         all adjacent pairs are sorted (which means the list is sorted)
   Ċ2         drop every second element from the list
```
[Answer]
# [C++ (gcc)](https://gcc.gnu.org/), 103 bytes
I can't comment, but I improved the version from movatica by reducing the includes, and using auto.
-2 Bytes: ceilingcat  
-2 Bytes: ASCII-only
```
#include<regex>
auto f(auto l){while(!std::is_sorted(l.begin(),l.end()))l.resize(l.size()/2);return l;}
```
[Try it online!](https://tio.run/##RY5BTsMwEEXX9SmGIiRbcoMoohVJyTW6QULBHqeWpnZkOyEiytVJTViw@iPNn/dGdd2uVWpZ7q1T1Gs8BWxxrFnTJw@Gr0Fi@rpYQn4Xky5LGz@iDwk1p@ITW@u4kFSg01wIQUXAaL8x79YQj3tRBUx9cEDV/O9RmWV9zZh1Ca7NLwUmtlmFA7xl9yobUCUfTrlUT08S9hKeJbxKeJFwkHCcRcU2xgf4@3SEEobMgS7kC8O3D/rdbSWMooKZzcuPMtS0cdkZ5Z3CLuXx3BDdAA "C++ (gcc) – Try It Online")
[Answer]
# [Crystal](https://crystal-lang.org/), ~~59~~ 50 bytes
With `Array#sort` (**~~59~~ 50 bytes**):
```
def f(a);while a!=a.sort;a.pop a.size//2;end;a;end
```
[Try it online!](https://tio.run/##Sy6qLC5JzPn/PyU1TSFNI1HTujwjMydVIVHRNlGvOL@oxDpRryC/QAHIyaxK1dc3sk7NS7FOBJH/CxTSFKINdRSMdBSMY7nAPBMwzxBCmQJZYIZJ7H8A "Crystal – Try It Online")
Without `Array#sort` (**~~102~~ 93 bytes**):
```
def f(a);while a.map_with_index{|e,i|e>a.fetch i+1,Int32::MAX}.any?;a.pop a.size//2;end;a;end
```
[Try it online!](https://tio.run/##Sy6qLC5JzPn/PyU1TSFNI1HTujwjMydVIVEvN7EgvjyzJCM@My8ltaK6JlUnsybVLlEvLbUkOUMhU9tQxzOvxNjIysrXMaJWLzGv0t46Ua8gvwCotTizKlVf38g6NS/FOhFE/i9QSFOINtRRMNJRMI7lAvNMwDxDCGUKZIEZJrH/AQ "Crystal – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~10~~ 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
£=ëÃæÈeXñ
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=oz3rw%2bbIZVjx&input=WzEgMiA0IDMgNV0)
```
£=ëÃæÈeXñ     :Implicit input of array U
£             :Map
 =            :  Reassign to U
  ë           :  Every second element, starting with the first
   Ã          :End map
    æ         :Get the first element that returns true
     È        :When passed through the following function as X
      e       :  Test for equality with
       Xñ     :  X sorted
```
[Answer]
# [VDM-SL](https://raw.githubusercontent.com/overturetool/documentation/master/documentation/VDM10LangMan/VDM10_lang_man.pdf), 99 bytes
```
f(i)==if forall x in set inds i&x=1or i(x-1)<=i(x) then i else f([i(y)|y in set inds i&y mod 2=0]) 
```
Never submitted in vdm before, so not certain on language specific rules. So I've submitted as a function definition which takes a `seq of int` and returns a `seq of int`
A full program to run might look like this: 
```
functions
f:seq of int +>seq of int
f(i)==if forall x in set inds i&x=1or i(x-1)<=i(x) then i else f([i(y)|y in set inds i&y mod 2=0]) 
```
[Answer]
# Pyth, 10 bytes
```
.W!SIHhc2Z
```
Try it online [here](https://pyth.herokuapp.com/?code=.W%21SIHhc2Z&input=%5B1%2C2%2C4%2C3%2C5%5D&debug=0). This removes the second half on each iteration, rounding down. To change it to remove the first half, rounding up, change the `h` to `e`.
```
.W!SIHhc2ZQ   Q=eval(input())
              Trailing Q inferred
  !SIH        Condition function - input variable is H
   SIH          Is H invariant under sorting?
  !             Logical not
      hc2Z    Iteration function - input variable is Z
       c2Z      Split Z into 2 halves, breaking ties to the left
      h         Take the first half
.W        Q   With initial value Q, execute iteration function while condition function is true
```
[Answer]
# [C++ (gcc)](https://gcc.gnu.org/), ~~139~~ ~~137~~ 116 bytes
*-2 bytes thanx to ceilingcat, -21 bytes thanx to PeterZuger*
```
#include<regex>
auto f(std::vector<int>l){while(!std::is_sorted(l.begin(),l.end()))l.resize(-~l.size()/2);return l;}
```
Resize the vector to its first half until it's sorted.
[Try it online!](https://tio.run/##RY5hS8MwGIQ/L7/i3BDyQlZxQ8V29pcMZCZvayAmJU2rWOpf77J@8dvB3T13uuv2rdbLsrNeu8HwKXLLP7W4DCmgkX0yZTmyTiGerE@1o@n70zqWd6tj@/c@xMRGuuKDW@slKVewN5KIXBG5t78s93@uWAU9HKiKnIbo4ar5f1Rnmg21EHkDX5cbB5PYrCdGvOUj06PCQeGo8KrwpPCs8DJTJTZNiJBrkFFizD10MWMaub03Z79VYKowi3m5Ag "C++ (gcc) – Try It Online")
[Answer]
# [Julia 1.0](http://julialang.org/), 33 bytes
```
-a=issorted(a) ? a : -a[1:end÷2]
```
[Try it online!](https://tio.run/##yyrNyUw0rPj/XzfRNrO4OL@oJDVFI1FTwV4hUcFKQTcx2tAqNS/l8Haj2P8OxRn55Qq60YY6RjomOsY6prFcCCEFIx0FYx0FEyCJLGwEVAfCJjqmOmY65joWQGgJZBka6RgZgoRNkKQQGkHGG0I1mkPkY/8DAA "Julia 1.0 – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), 7 bytes
```
ΩS=Oo←½
```
[Try it online!](https://tio.run/##yygtzv7//9zKYFv//EdtEw7t/f//f7ShjpGOsY6JjnEsAA "Husk – Try It Online")
removes last half.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
m⁻Ṣ$¿2
```
[Try it online!](https://tio.run/##y0rNyan8/z/3UePuhzsXqRzab/T/cPujpjX//0cb6hjpGOuY6JjG6ijAOcaxAA "Jelly – Try It Online")
Very similar to [Erik](https://codegolf.stackexchange.com/a/182256/66833)'s existing answer, but I came up with this independently, and Erik's no longer active.
## How it works
```
m⁻Ṣ$¿2 - Main link. Takes a list L on the left
    ¿  - Loop while the condition is false, updating L each time:
   $   -   Condition:
  Ṣ    -     L sorted
 ⁻     -     L ≠ L sorted
m    2 -   Body: Take every second element of L
```
]