Please enable JavaScript.
Coggle requires JavaScript to display documents.
DS (Definition:
A data structure is a way of organizing data so that it…
DS
Why data Structures?
- They are essential ingredients in creating fast and powerful algorithms
- They help to manage and organize data.
- They make code cleaner and easier to understand
- Complexity Analysis
There are two questions which are often asked by programmers:
- How much time , O(n) does this algorithm need to finish?
- How much space , O(t) does this algorithm need for its computation.
Space - Big-O Notation
n - The size of the input
Complexities ordered from smallest to largestComplexities
Complexities Examples:Greatest O(n)As shown in the above img -> Big(O) notation is always the greatest O(n) time complexityNote: A loop itself can be of constant time if it does have a fixed value to which it will loop through. Otherwise if the value changes then its not constant.O(1)O(n)O(log(n))O(n^2) OR O(n^2)O(n^4)Other variations
-
Abstract Data Types vs. Data Structures
The interface does not give any specific details about how something should be implemented or in what programming languageSo, the point here is that ABT defines how a data structures should behaving, and what methods it should have, but not how it is implemented Abstract data types photo
-