Posts

The Further Steps – Contesting And Continuing Practice – Competitive Programming last part of series

The Further Steps – Contesting And Continuing Practice – Competitive Programming last part of series If you have followed the first three parts of the series, you’d now be very well acquainted with the world of Competitive Programming. By now, you’d have started competing already. So, what are the further steps you can take to become a kickass competitive coder? – Contest in all the contests that you come across – Continue the practice in various online judges Regarding the contest, here are the most popular places you can contest online. 1. Topcoder Topcoder is the best and the most popular online judge with respect to contests. They have a variety of contests going on every now and then. Their SRMs are the most popular ones. There are various categories of contests, and more so, the prize for the contest winner is money. Practicing with past SRMs and contesting in the new SRMs whenever they conduct these matches, in Topcoder especially, will give you a great edge...

Practice Guidance For Competitive Programming – Competitive Programming Series Part-3

Practice Guidance For Competitive Programming – Competitive Programming Series Part-3 If you haven’t read the first two parts of this series, you can read them from below posts. This part will lead you with the next step in your programming journey. This is the part where you actually start practicing problem-solving, competitive programming style. The following is the way I have found to be the most effective. 1. spoj.com The first step in your competitive programming practice, for it to be the most effective, choose these two websites. SPOJ is the best and the leading forerunner in terms of programming contest style questions. Their online judge is awesome. SPOJ engine is also used by CodeChef. The way to practice problems is this. You have to sort the problems in descending order of number of users who solved a problem. If it helps, here is the link for that – http://www.spoj.com/problems/classical/sort=6 – bookmark it. Also, go and check out ProjectEuler. Cr...

Competitive programming part-2

Problem Solving Using Algorithms and Data Structures – Competitive Programming Part-2 This part will deal with the next step in your journey – starting to solve problems using data structures and algorithms. There are many ways to do this. I have personally found going through a few things very apt in this process. This part will give you a step by step guidance. Once you have started learning algorithms and data structures, do it this way for the most effective experience. Learn algorithms according to a category, like sorting, searching, stacks, queues, etc,. Geeks For Geeks: Once you learn the data structure/algorithms in a particular category, head over to  Geeks For Geeks – Data Structure Problems . Solve all the problems in the category of data structures/algorithms that you have learned. Say, you learn all about stacks, stack operations. You then head over to geeksforgeeks and solve all the problems listed under stack. Before seeing the so...

No idea how to start CP journey? Here you go!

Programming And Algorithms Basics – Competitive Programming Series – Part1 The first step you take venturing into the world of competitive programming is to learn programming – programming language(s), their constructs, logic, basic problem-solving and algorithmic approach to the same. This part will give you the essential guidance for accomplishing all of the above. I) Programming Languages: The very first thing you need to learn is a programming language. People talk to each other using a language. If you are a native English speaker living in America, you probably communicate to your friends, fellow human beings in English. But, when we need to communicate with a computer, we can’t use the every-day English. That’s where a programming language comes in. So, which programming language do I choose to start with? There are so many programming languages one can start with. Nothing beats C Programming though. Why C Programming? As a college student, we are all taught C Pro...

Exact String Matching Algorithms

Image
Preliminary Definitions A string is a sequence of characters. In our model we are going to represent a string as a 0-indexed array. So a string S = ”Galois” is indeed an array [‘G’, ’a’, ’l’, ’o’, ’i’, ’s’]. The number of characters of a string is called its length and is denoted by |S|. If we want to reference the character of the string at position i, we will use S[i]. A substring is a sequence of consecutive contiguous elements of a string, we will denote the substring starting at i and ending at j of string S by S[i...j]. A prefix of a string S is a substring that starts at position 0, and a suffix a substring that ends at |S|-1. A proper prefix of a S is a prefix that is different to S. Similarly, a proper suffix of S is a suffix that is different to S. The + operator will represent string concatenation. Example: S = "Galois" | S |= 6 S [ 0 ]= 'G' , S [ 1 ]= 'a' , S [ 2 ]= 'l' ,..., S [ 5 ]= 's' S [ 1. .. 4 ]= ...