Posts

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 ]= &

How should I be a brilliant student in programming?

1.Decide why you want to become a good programmer: Is it because you want a job, preferably in a high paying software firm? Great. Then you are set to reach NOWHERE. All good programmers I know are good because they loved what they did. Develop interest in programming. See, programming is the only branch in engineering where you can straightway apply what you learn. Your dad may have a car but he certainly wont allow you to tweak the V2 or swap it for a v6 just to see what happens. But with computers you can do whatever you want. You want to simulate a virus? Cool. Install a virtual OS and run it. Then, when you are done, remove the virtual hard disk. If you are good at what you do, you will get paid and surely get that dream job. Yes, even I want to work in a big software company. But thats not because of the fat paycheck. Its because of the work they do. Because of the exposure I will have. Have you ever bothered to find out what all these companies do and the enabling technologies