Learn About Discrete Algorithms for Project

Click For Summary
SUMMARY

The discussion focuses on discrete algorithms, emphasizing their definition as procedures that yield outputs for specific tasks. Key concepts include "big O notation" for evaluating algorithm efficiency and examples such as Euclid's algorithm for finding the greatest common factor. The conversation highlights the inefficiencies of various sorting algorithms, contrasting bubblesort (O(n^2)) with quicksort (O(n log n)), illustrating the importance of selecting the right algorithm for optimal performance.

PREREQUISITES
  • Understanding of basic algorithm concepts
  • Familiarity with big O notation
  • Knowledge of sorting algorithms, specifically bubblesort and quicksort
  • Basic programming skills to implement algorithms
NEXT STEPS
  • Research "big O notation" for algorithm efficiency analysis
  • Study Euclid's algorithm for greatest common factor calculations
  • Learn about sorting algorithms, focusing on quicksort and its implementation
  • Explore algorithm complexity and performance trade-offs in different scenarios
USEFUL FOR

Students, software developers, and anyone interested in understanding algorithms and their applications in problem-solving and programming efficiency.

joecaveman
Messages
1
Reaction score
0
I have a project to do on algorithms, and as far as I can tell, the project is due before we cover the topic :p.

My textbook only makes a slight reference to what an algorithm is :(.

Can anyone point me in the direction of a website or book that tells me all there is to know about algorithms?
 
Physics news on Phys.org
Algorithms is a pretty large subject: You may want to be a bit more specific. Algorithms themselves are just set procedures that will produce an output to a specific task or problem. If you want to understand the efficiency of an algorithm I suggest you look up "big o notation". I think that it's important to note that algorithms can be counterintuitive in that the shortest algorithm is rarely the fastest for a given problem.

An example of a classic algorithm would be Euclid's algorithm for finding the greatest common factor of two numbers, which uses the idea that gcf(y, x) = gcf(x, y mod x).

A good example of the problem of choosing an algorithm is the problem of sorting an array of numbers in a particular order using a computer program. There are many options to accomplishing this task. One of the most inefficient methods would be simply to ask the computer to produce every possible permutation of the array and to select the sorted one (run time o(n!)). A typical high school level implementation of that task would involve the bubblesort algorithm, which checks each element and only the elements at a position in the array greater than the one being checked and will swap the two if the two are not sorted according to the method you want the array to be sorted (run time o(n^2)). There are still faster ways, such as quicksort, which has a run time of o(n*log(n)), and calls for a sort of complicated to explain recursive sorting of the array into two partitions consisting of numbers greater than a certain number (called the pivot) and numbers less than that number, and then proceeds to recurse down until each partition is one element. Quicksorts are typically 20 lines of code in most programming languages compared to maybe 5 lines for bubblesort.

I hope I at least gave you some keywords to look up in your search.
 

Similar threads

Replies
86
Views
3K
  • · Replies 43 ·
2
Replies
43
Views
8K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
3
Views
2K