Monday 7 July 2014

Radix Sort

Radix sort is one of the linear sorting algorithms for integers. It functions by sorting the input numbers on each digit, for each of the digits in the numbers. However, the process adopted by this sort method is somewhat counterintuitive, in the sense that the numbers are sorted on the least-significant digit first, followed by the second-least significant digit and so on till the most significant digit.


Radix Sort Is the One of the Fastest Sorting algorithm doing it in order
O(k*N) 





def radixsort():
    num=[]
    for i in range(10):
        num+=[[]]
    nums = [int(j) for j in raw_input().split()]
    maxn = len(str(max(nums)))
    sortn = nums[:]
    for x in range(1,maxn+1):
        i=-1*x
        for j in sortn:
            z = str(j)
            if(len(z)<x):
                num[0]+=[j]
            else:
                num[int(z[i])]+=[j]
        sortn=[]
        for k in range(10):
            sortn+=num[k][:]
            num[k]=[]
    print sortn
radixsort()                

Wednesday 2 July 2014

Python Programming


Dont Know Programming?

Want To Learn A easy and flexible language to start with?


If Yes Then this is for you

Python

Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C. The language provides constructs intended to enable clear programs on both a small and large scale.


Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library.


Official Website :  Python 

How To start learning :

1. Go To the above website and install python interpreter 

2 . Take this tutorials , this is the best for begginers

The NewBoston Python Tutorials

3. Doesnt End with these two steps, go to HackerRank and CodeChef and Practice problems form these this will help you to remember the syntaxes properly

Tuesday 1 July 2014

About Me



I am Arun , Doing my Integrated Mtech (Information Technology) in IIIT Bangalore.

I like programming, i take part in various competetions like ACM-ICPC and other challanges in HackerRank.

I use C as my primary language in programming.
Its very fast , doesnt take too much memory.

I attend most of the sessions and workshops conducted by GDG bangalore.They are interesting and highly useful for career.

I contribute to opensource projects when ever i can.

Follow Me on :

Facebook

Google+

Twitter

GitHub

Competitive programming

Competitive programming is a mind sport usually held over the Internet or a local network, involving participants trying toprogram according to provided specifications. Competitive programming is recognized and supported by several multinational software and Internet companies, such as Google, Facebook, and IBM. As of January 2012 there are several organizations who host programming competitions on a regular basis.


A programming competition generally involves the host presenting a set of logical or mathematical problems to the contestants (who can vary in number from tens to several thousands), and contestants are required to write computer programs capable of solving each problem. Judging is based mostly upon number of problems solved and time spent for writing successful solutions, but may also include other factors (quality of output produced, execution time, program size etc.)


Source : Wikipedia


How to Prepare For Competitive Programming?

First Of all , for programming good mathematical skills are required
so to achieve this go to this Course
Mathematics for Computer Science
This has a set of video lectures for discrete math, this is aimed for programming competetions.

Second , The heart of programming is Algorithms and Data Structures , without this you cannot program efficiently.

In mathematics and computer science,
an algorithm is a step-by-step procedure for calculations.
Algorithms are used for calculation,
data processing, and automated reasoning.


Link : Introduction to Algorithms