New course! Every coder should learn Generative AI!
Try a free lesson+ 30
I have no professional experience in evaluating algorithms, but based on common sense:
A good algorithm :
• should be efficient :
- solves problems in the least steps possible.
- uses minimal resource to achieve the solution.
• should be easily understood :
- reflects real-life problem-solving steps.
- can be maintained at minimal cost.
• should be flexible :
- handles all kinds of exceptions and errors.
- is self-sustainable.
- can be applied in a wide variety of similar problems.
• should have balance (!) :
- The shortest and most efficient algorithm may not be the most readable/maintainable. Suitable algorithms should be chosen after evaluating specific conditions in real life.
• should actually solve your problem.
+ 17
well Ace u know more than me but my views are:
The characteristics of a good algorithm are:
1.Precision – the steps are precisely stated(defined).
2.Uniqueness – results of each step are uniquely defined and only depend on the input and the result of the preceding steps.
3.Finiteness – the algorithm stops after a finite number of instructions are executed.
4.Input – the algorithm receives input.
5.Output – the algorithm produces output.
6.Generality – the algorithm applies to a set of inputs.
+ 12
How fast the black box returns something? (Runtime)
+ 11
{Walks into black box store}
Oh look, the algorithm in this one generates waste heat. But I bet this would keep someone's toes warm on a cold winter night ~
{Walks into a forest}
Trees!*
* Box-making materials.
+ 8
Simplicity and the one that uses less time.
I think majorly that time is the big thing here
+ 4
adding a last point :
should be as crossplatformed as possible or
constraint independent as possible
+ 3
Simplicity :)
+ 3
@Ace: I would say by storing the string in an array and checking against a single character first using a loop condition and set up some sort of flag to tell me if any are missing from that set or not (1-9). next, id repeat the process and check against a double character (10-99) to see if anything is missing. if so, I will find my value. if not, repeat and check against a triple character (100-250) to see what is missing. using this method, the algorithm is optimized so that I only check each group once. i would probably code this in c/c++ if necessary
I could on the other hand sort the numbers first before attempting to find the missing number, but that would increase my overal run-time complexity
+ 3
I good algorithm is one that is free of mistakes or errors. This way your code always satisfies the right answer and never fail. That's why I think keeping your code safe is important. There are programs that helps doing that you can use, such as checkmarx which I've heard of.
Good luck.
+ 2
A good algorithm should address the problem at hand without propagating another issue in a simplistic way. Space and Run-time complexity should also be considered.
@Ace: Got an interview at Google in two days. I've been doing some independent study on Data Structures and Algorithms so far, but would you recommended any last minute prep that I should consider focusing on?
+ 2
@Ace . Ok, well I just ordered a book from Amazon a few days ago: Programming Interviews Exposed and it seems to really lay out everything regarding Structures, Algorithms, and some System Design topics, I think.
Im well aware of the NDA, and I wouldn't want to neither compromise myself or anyone else. I think I'm more nervous than anything else. If I can manage to pick up multiple programming languages within a short period of time and also be able to teach myself about data structures and algorithms, I should be fine. I really just want to do well and make it to the next round
Just as a simple test, could you provide me an abstract practice problem that I could potentially be tasked to solve? (One that is NOT related to Google.)
+ 2
Algorithms can make systems smarter, but without adding a little common sense into the equation they can still produce some pretty bizarre results.
The characteristics of a good algorithm are:
Precision – the steps are precisely stated(defined).
Uniqueness – results of each step are uniquely defined and only depend on the input and the result of the preceding steps.
Finiteness – the algorithm stops after a finite number of instructions are executed.
Input – the algorithm receives input.
Output – the algorithm produces output.
Generality – the algorithm applies to a set of inputs.
Regards,
Christian
+ 1
@Ace: Could you give me another more challenging algorithmic problem? Something that I would have to put even more considerable thought into?