Starting last weekend I have started picking up problems from the certification syllabus of the Codechef Certified Data Structure & Algorithms Programme: CCDSAP ( https://www.codechef.com/certification/prepare ). I would definitely recommend solving the practice material even if you are not willing to go for the certification.
I'll solve these in increasing order of difficulty and not necessarily sequentially while skipping the cake-walk ones and also probably the ones that I have done previously.
This way I can ensure this series of self-paced hackathon-cum-blogathon will eventually come to an end, with an end to the problems in this syllabus.
~
PROBLEM: http://www.spoj.com/problems/STPAR/
I had done this problem earlier so it was a good candidate for an ice-breaker. I first (sometime in 2010) solved this in Java. This time in C++ using an on-the-fly algorithm that doesn't store all inputs before processing them but processes each input as it comes in a single pass.
SOLUTION: https://github.com/glassrose/CPP_Problem_Solving/blob/master/SPOJ-STPAR.cpp
Tested and accepted at : http://www.spoj.com/status/STPAR,chandniverma/
The time complexity is O(n).
Space needed is O(n) (actually only n).
* SDE Career Contemplations * DSA Practice * Problem Solving in Java * Tech in General * Open Source guidance * Career guidance
Subscribe to:
Post Comments (Atom)
Featured Post
interviewBit Medium: Palindrome Partitioning II
Problem Name: Palindrome Partitioning II Problem Description : https://www.interviewbit.com/problems/palindrome-partitioning-ii/ Problem Ap...
-
Many users had requested this feature ( bug ) and it is now available for all to use. Now Empathy supports blocking/unblocking contacts on ...
-
I have been using Linux for quite some time now but only recently got a chance to peek into the internals of the OS I work on in detail. Uni...
-
Hi all, Last week I created a new popup feature that would allow the users to quickly enable/disable accounts from the accounts tree-view ...
No comments:
Post a Comment