Data Structures and Algorithms
Watch
Basic Recursion
Data Structures in 15 Minutes
Big O Explained
Read
Basic Data Structures
Why Big O
Discussion Questions
What is 1 of the more important things you should consider when deciding which data structure is best suited to solve a particular problem?
One of the most important things to consider is the scalability of the data. For example, if you require a data structure to handle each day in a month, the largest this data structure will grow is 31 elements. An array could be a proper data structure for this example. However, a single array would be a poor choice if you have more complex data with the potential of infinite scaling that would hold millions of indexes. A hash table may be a better choice for scaling data due to its ability to handle nested data structures of different types. Each situation is going to vary depending on the data.
How can we ensure that we’ll avoid an infinite recursive call stack?
An infinite recursive call stack occurs when a function calls itself with no conditional statement or a way to return
out of the function. To prevent an infinite recursive call stack, adding a conditional with a return statement that will eventually be met will stop the loop.