Tell me if my code "looks" bad. I care.
https://medium.com/@sinameraji/
If you ever look at my code and think the question I'm asking isn't the right question to ask, tell me.
Henry Wong wrote:From your description, I doubt that you are taking a data-structures course. It is probably just a beginners Java course.
A University data-structures and algorithms course generally implements the data structures (and not just how to use them)... in other words, you get to write your own version of lists, trees, etc.
Henry
Tell me if my code "looks" bad. I care.
https://medium.com/@sinameraji/
If you ever look at my code and think the question I'm asking isn't the right question to ask, tell me.
Sina Meraji wrote:
Yes Henry we got to write our own versions of them, and to create their methods etc. But still, I'm failing to see the advantage..
Karthik Shiraly wrote:This is an excellent question, and deserves a detailed answer.
Firstly, I would not equate basic data structures like arrays and linked lists, with more complex data structures like queues
and graphs whose characteristics are not just the relationships within their data but also the operations they define on that data.
These complex data structures are fundamental to many AI algorithms:
A large number of AI problems reduce to tree and graph search problems where the nodes are different states and the AI should
calculate the "best" path from current state to a particular state.
Most of the well known graph algorithms for best first search - like A* or Djikstra's - use both graphs and priority queues
as their fundamental data structures.
In supervised machine learning, regression and classification of inputs are common tasks. Algorithms like artificial neural networks,
decision trees classifiers, boosted tree classifiers, and random forest classifiers all use weighted graphs as their
fundamental data structures.
ML itself is a cross cutting field that has applications in different areas like computer vision, linguistic interpretation, audio, signal and speech processing.
So any data structure that is used by an ML algorithm is also getting indirectly used in the area where that algorithm itself is being used.
In natural language processing, parse trees are a fundamental concept.
In speech recognition, markov chains are modelled as weighted graphs.
Can you model all data as arrays and all algorithms to use only arrays? Sure. But often it involves some kind of unacceptable space vs time trade offs.
That's the reason alternative structures like linked lists are used.
What you should take away from this semester class is the intuition to calculate and understand things like algorithmic complexity and space time trade offs.
That knowledge is golden and something which will come up often especially in an algorithm intensive field like yours.
If you want to build an appreciation and motivation for data structures and algorithms, my suggestion is to explore and implement algorithms like the above from scratch.
The main reason most software engineers can't appreciate their importance is because we tend to use libraries where all the data structure and algorithm thinking has already been done by somebody else.
Strive to be one of those thinkers, not just one of the users.
Tell me if my code "looks" bad. I care.
https://medium.com/@sinameraji/
If you ever look at my code and think the question I'm asking isn't the right question to ask, tell me.
Willie Smits can speak 40 languages. This tiny ad can speak only one:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|