Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Algorithms/Quick Sort/quicksort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# a ---> array to be sorted
# p,r ---> segment of array (sub array) being sorted
# q -----> index of the partition

def divide(a,p,r):
k=a[r]
q=p
for i in range(p,r):
if a[i]<=k:
a[i],a[q]=a[q],a[i]
q+=1

a[q],a[r]=a[r],a[q]
return q

def quick_sort(a,p,r):
if p>=r:
return

q=divide(a,p,r)

quick_sort(a,p,q-1) # recurse on left sub-array
quick_sort(a,q+1,r) # recurse on right sub-array

n=int(input())
a=list(map(int,input().split()))

quick_sort(a,0,n-1)
print(*a)
18 changes: 18 additions & 0 deletions Intro.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Data is the new Oil. This statement shows how every modern IT system is driven by capturing, storing and analysing data for various needs. Be it about making decision for business, forecasting weather, studying protein structures in biology or designing a marketing campaign. All of these scenarios involve a multidisciplinary approach of using mathematical models, statistics, graphs, databases and of course the business or scientific logic behind the data analysis. So we need a programming language which can cater to all these diverse needs of data science. Python shines bright as one such language as it has numerous libraries and built in features which makes it easy to tackle the needs of Data science.

In this tutorial we will cover these the various techniques used in data science using the Python programming language.

Audience
This tutorial is designed for Computer Science graduates as well as Software Professionals who are willing to learn data science in simple and easy steps using Python as a programming language.

Prerequisites
Before proceeding with this tutorial, you should have a basic knowledge of writing code in Python programming language, using any python IDE and execution of Python programs. If you are completely new to python then please refer our Python tutorial to get a sound understanding of the language.

Execute Python Programs
For most of the examples given in this tutorial you will find Try it option, so just make use of it and enjoy your learning.

Try following example using Try it option available at the top right corner of the below sample code box

#!/usr/bin/python

print "Hello, Python!"