183df6889b6599dfd2c6c159128786805ce77bdf,sorts/quick_sort.py,,quick_sort,#Any#,21
Before Change
if total_elements <= 1:
return collection
less = []
equal = []
greater = []
pivot = collection[0]
equal.append(pivot)
for i in range(1, total_elements):
element = collection[i]
if element < pivot:
less.append(element)
elif element == pivot:
equal.append(element)
else:
greater.append(element)
return quick_sort(less) + equal + quick_sort(greater)
if __name__ == "__main__":
import sys
After Change
return ARRAY
else:
PIVOT=ARRAY[0]
GREATER=[element for element in ARRAY[1:] if element>PIVOT]
LESSER=[element for element in ARRAY[1:] if element<=PIVOT]
return quick_sort(LESSER)+[PIVOT]+quick_sort(GREATER)
if __name__ == "__main__":
import sys
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 13
Instances Project Name: TheAlgorithms/Python
Commit Name: 183df6889b6599dfd2c6c159128786805ce77bdf
Time: 2017-04-04
Author: alaoui.mehdi.1995@gmail.com
File Name: sorts/quick_sort.py
Class Name:
Method Name: quick_sort
Project Name: donlnz/nonconformist
Commit Name: aab2ef03ff533c1160742fafd2bf12133e227ddb
Time: 2015-03-19
Author: henrik.linusson@gmail.com
File Name: nonconformist/ensemble.py
Class Name: AggregatedCp
Method Name: predict
Project Name: matplotlib/matplotlib
Commit Name: 16e3df83d4f233c9b76db9f9b51a08a217f3828c
Time: 2019-01-27
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/bezier.py
Class Name:
Method Name: concatenate_paths
Project Name: tyarkoni/pliers
Commit Name: e5e5ee0c3f7f7438a2519d32458fa72ea7af98e4
Time: 2016-10-23
Author: quinten.mcnamara@gmail.com
File Name: featurex/extractors/google.py
Class Name: GoogleVisionAPIExtractor
Method Name: _extract