Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411560 Posts in 69384 Topics- by 58443 Members - Latest Member: junkmail

May 03, 2024, 01:33:42 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)C++ : Tutorials on Algorithms
Pages: 1 [2]
Print
Author Topic: C++ : Tutorials on Algorithms  (Read 4432 times)
Netsu
Level 10
*****


proficient at just chillin'


View Profile WWW
« Reply #20 on: April 13, 2014, 04:15:12 AM »

Honestly, went to university. Studied hard and left pretty high up in my class. Left with a great grade as well. I think somewhere since then my skills have dwindled. Perhaps a C++ course is needed to refresh my memory. It's been 2 years since university.

Sometimes it's hard to program with a learning disability. I do my best. After this weekend I've decided to go back to my university to relearn my skills. Hopefully on friday I will be back to where I left university.

Sorry to be a burden to you all.

No need to apologize, everyone in this thread tried to help of their own will. I hope you'll be able to relearn everything quickly Hand Thumbs Up Right

Sorting the list for PermCheck is O(N lg N), not O(N). You just want to loop over the array and count the values. That they give you O(N) memory space is a clue.

Good catch, I missed that.  Strangely enough using sort still gave 100% in the test so I guess you should take the results with a pinch of salt.

They probably just time your results so if your solution is fast enough the actual asymptotic complexity doesn't matter. You sure could get a low grade even with a O(n) solution if it was very slow.
Logged

King Tetiro
Level 1
*



View Profile WWW
« Reply #21 on: April 13, 2014, 05:32:34 AM »

Quote
No need to apologize, everyone in this thread tried to help of their own will. I hope you'll be able to relearn everything quickly

Can I ask for you guys help once again? I have been installing C++ on my laptop to relearn. However it just won't do as it is told to. Even though I blew the installation away. I have posted a link to my stackoverflow article to prevent cluttering on this topic

http://stackoverflow.com/questions/23043198/winapifamily-h-no-such-file-or-directory


- I gave up with this. It just won't work. No matter what I did it would keep that same error. I'm going to try this on Visual Studio Express and see what happens.


Btw, is it bad of Codility will break when I try to compare a char variable? Example is this if (variable == ')'). I ask because the program just freaks out and throws so many errors. Now I'm just a beginner (I think this weekend proved that) at C++ but I do know that something like this shouldn't cause that many errors. I cut the programming to use 1 if statement and it still had this problem. I think the C++ on Codility is broken. Unless anyone can tell me what I did wrong in my comparison?
« Last Edit: April 13, 2014, 06:33:25 AM by King Tetiro » Logged
Polly
Level 6
*



View Profile
« Reply #22 on: April 13, 2014, 06:35:10 AM »

Btw, is it bad of Codility will break when I try to compare a char variable?

Works just fine for me. Out of curiosity, what was your major in university?
Logged
Netsu
Level 10
*****


proficient at just chillin'


View Profile WWW
« Reply #23 on: April 13, 2014, 06:43:34 AM »

Btw, is it bad of Codility will break when I try to compare a char variable? Example is this if (variable == ')'). I ask because the program just freaks out and throws so many errors. Now I'm just a beginner (I think this weekend proved that) at C++ but I do know that something like this shouldn't cause that many errors. I cut the programming to use 1 if statement and it still had this problem. I think the C++ on Codility is broken. Unless anyone can tell me what I did wrong in my comparison?

Could you post the entire program code and the compiler errors?
Logged

King Tetiro
Level 1
*



View Profile WWW
« Reply #24 on: April 13, 2014, 10:08:12 AM »

Btw, is it bad of Codility will break when I try to compare a char variable?

Works just fine for me. Out of curiosity, what was your major in university?

Computer Games Development.

Btw, is it bad of Codility will break when I try to compare a char variable? Example is this if (variable == ')'). I ask because the program just freaks out and throws so many errors. Now I'm just a beginner (I think this weekend proved that) at C++ but I do know that something like this shouldn't cause that many errors. I cut the programming to use 1 if statement and it still had this problem. I think the C++ on Codility is broken. Unless anyone can tell me what I did wrong in my comparison?

Could you post the entire program code and the compiler errors?

I don't have it at hand but I'll see if I can replicate the errors.
Logged
gupta_shvm
Level 0
**


View Profile
« Reply #25 on: April 14, 2014, 11:55:19 AM »

It's not necessary to use STL most of the time when doing algorithmic problems. You should be proficient at writing vanilla C++ code though. They give you the limits, so create arrays that are of that size. The point of algorithmic problems is to test algorithms, not software development skills.
That said, proficiency in algorithms helps a lot when making software. Plus, hard algorithmic problems are just fun to solve. It's great to finally discover an amazing idea after a lot of time spent thinking

I recommend checking out the Intro to Algorithms book that someone mentioned earlier. It's a bit dense if you're new to algorithms though.. Also, if you're interested, check out the USACO training site. It's designed for high-schoolers in the US who are interested in participating in the International Olympiad in Informatics, but it's very useful for learning because it starts with basic algorithms like sorting, searching, etc., and moves up to more advanced topics such as graph theory and dynamic programming.
http://usaco.org/index.php?page=training
Also, check out competitive programming competitions. Competitions usually take place on the following sites every few days:
http://www.topcoder.com/
http://codeforces.com/
http://www.codechef.com/
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic