patrick
Can anyone provide me algorithme lessons please? ( preferably in french :P )
I'm having a lot of troubles learning
thank you
N.b : Tricks or methods to be able to create anything asked ?
Also , I have this problem to solve. I ve spent hours on it , still no solution:
I have to make a program with the following :
chose a number , with variables having only 1 and 0 ( ex : 0010111001 )
It can be as long as it can.
I have to make the program , cut the number, so that I obtain the number of "1" in the left of my cut line , and the number of "0" on the right of that line.
Condition, the sum of both sums, should be minimal.
Example :
010011
I cut into the following : 01 0011
1 2
That makes a sum of 3 . That's the lowest sum you can get.
Any idea please ?
P.s : I m not trying to get an answer easily , and let you do my homework . It's just that I can't figure out. I spent 3 hours on it, still nothing. The minimum score that i must get is 8/20 , or i m eliminated from my uni. So please, if you can share out some tips, help me out !
Thank you for your time
J4D
i dont know a lot about this subject but dont worry , i guess alot of the guys know this here .
what are you studying :) and where ?
battikh
course in french:
http://www.pise.info/algo/introduction.htm
how detailed should the algorithm be?
simple one (i don't think i'm using the correct algorithm syntax):
smallest_sum=999
smallest_cut=0
get input number
for all cuts going from 0 to the length of the number, do
ones = number of ones on the left of the cut
zeros = number of zeros on the right of the cut
sum = ones + zeros
if sum < smallest_sum then smallest_sum=sum and smallest_cut=cut
cut = cut + 1 (to repeat for the next possible cut)
end for
answer: smallest_cut, smallest_sum
J4D
was that what you call it " sansekreete " ? :lol: i got nothing , and i doubt patrick did :P ofcource the problem is us not you :D
Ayman
was that what you call it " sansekreete " ? lol i got nothing , and i doubt patrick did tongue ofcource the problem is us not you big_smile
That's pseudo code Jad, not sansekreete :mad: :P
J4D
im kidding :P i know its a type of code :lol:
patrick
Ai ! I forgot to mention that my algorithm should be very detailed :P
But thanks anyway, i got the correction. The basic idea is not bad, but instead of using the 999 , a LEN character would be enough ( for the smallest sum )
That's what my teacher said at least :P. He liked the forums...
And the thing is , I'm still not very comfortable with this algorithme stuff. I'm gonna have to spend some time researching and revising using the link you provided me. Thank you a lot Battikh
patrick
jadberro wrotei dont know a lot about this subject but dont worry , i guess alot of the guys know this here .
what are you studying :) and where ?
i m still in my engineering annee preparatoire , and In france, specifically in angers
Georges
Find a Man Named : Pierre Khorassadjian. known for Pkay ! :cool: He Teaches Algorithm Analysis and Design. He's Currently the Director of the AUT Campus in Saida ;)
mohqas
patrick
thanks guys, i just got my first note : 8/20
sucks a lot...
I have no idea where to start
samer
Algorithms: Dasgupta, Papadimitriou, Vazirani.
Very well written and freely available.
URL:
http://www.cs.berkeley.edu/~vazirani/algorithms/all.pdf
nablaux
patrick wrotethanks guys, i just got my first note : 8/20
sucks a lot...
I have no idea where to start
Hello Patrick.
I think the best way to start is to work on an example. I saw the example you have already posted but i am quite sure you know the answer by now. If you want post another problem or if you want I can come up with a problem and then we try to solve it. The discussion will reveal the weak points that need to be addressed.
best
patrick
Thank you Samer, and Thank you Nablaux, I will, when I have time, post a random algorithm excercice, and try to solve it myself.
I think the most common weak point is the fact that the lessons are more into the theory , and less into the practical , so it's taking me some time to realize and imagine the solution.
I tried to recheck battikh's link, it seems like an excellent link because it's in french , and it has exercises with corrections.
My algorithm professor just doesn t care, and talks to us as if we were already advanced.
Though what's really really annoying me , is that basically all french students understand him , and the rest ( of various ethnicity , from gabon , lebanon, maghreb, algeria ) don't understand at all.
Are we stupid ?
nablaux
:)
you are not stupid.
Listen, to be able to understand these things you need to learn a way of thinking. This way of thinking is something you acquire and as far as i am concerned this is why we study and go to universities etc...
I mean, for example we dont really need to know, nor memorize what the multiplication of two numbers is, HOWEVER we need to understand what does it mean right? as for the result of a multiplication this can be answered easily by a calculator or a simple computer program.
Basically what I am trying to say is that it is not important to know what is the derivative(for example) of x^2 but it is important to understand what is a derivative and how we can use it and benefit from it, and this is exactly what we need to learn or focus on when studying. This is the tool that stays with us and we will, without a doubt, forget everything else. But this tool allows us to tackle any related problem easily or when reading some new (related) material we can understand it easily because we would have acquired the WAY OF THINKING that allows us to look at the info in the correct angle.
ok, maybe what i said is a bit abstract. please let me know if does make any sense to you guys.
Anyways, as algorithms go, I will try to write a very naive but systematic introduction of the goal and the different aspects of an algorithm. Once I finish it I will post it here.
Joe
I had a similar problem when I first got to France. I took a C course, and I couldn't keep up with the rest of the class. I found the teacher to go way too fast over most points. And somehow, the others seemed fine with it. Don't worry, after some time you naturally cope with the rhythm of your environment. For now ... just hang on.
patrick
Thank you everyone !
Appreciated everything.