Posts

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...

Everything you need for being a good rated coder in CP

So guys thanks to all for viewing my blog i assure you all that i will upload all the best resources and tips by which you can become a good rated coder.So subscribe my blog if you like it.:)

Simple book for Data structures and agorithms

Many people complains that they find CLRS a bit tough at starting so after asking many senior programmers i have concluded that http://read.pudn.com/downloads160/ebook/719437/The_Algorithm_Design_Manual(Springer_Verlag).pdf   this book is a good choice for all the beginners.After this book students may find  CLRS concepts easy to grasp.

What are the common mistakes made by beginner competitive programmers?

Please note that this answer is dedicated to competitive programmers only, as well as some recommendations in it. Competitive programming is not about readability, but about being able to code and debug fast. And still, the mains problems that I've seen: laziness and do not caring about code style even a little. That's ok if your program gets Accepted on first try, but otherwise you're gonna have a bad time debugging it. In general. So, mistakes (all of them are real stories): Focusing on easier and 'cooler' things (like using of bitwise operations a lot instead of straightforward mathmatical formulas) instead of making code simpler to read and debug. Not only for them, but for the one who will help them too. Copy-pasting it all around. "We don't need no architecture, just a little hack here is not bad. Oh, and here is another one. And here. C'mon, I still can tell you how is this supposed to work, but it doesn't work somewhy, can you help me?...

Can I become a really good self-taught programmer?

Here is what I can tell you about becoming a self taught programmer. The rational of becoming a self taught for something is strong. However, it depends on how far the first initial pushes will get you, because that ambition will need to fuel you to the rest of the way. That is one way to determine how bad or good one could become at something. Building a mantra or lets say a rough plan can be helpful. I would say a rough plan, since plans tend to be cute, beautiful and motivated like babies, but they need to be changed often. Being ready to change them is a key here. Avoid things like four steps, or 10 hour guides, since if one get stuck at a step, it will feel like an overwhelming task going around it, the better approach is a following the rough plan. So here is my rough plan: Fun:  This needs to approached as a fun activity to do rather than a learning path that might never end or an office routine, because being a self taught is a bit different than going to school. ...