Data Structure Algorithm concepts
Ajith_cheet_Sheet Data Structure algorithm ### Array ####Definition: Stores data elements based on an sequential, most commonly 0 based, index. Based on tuples from set theory. They are one of the oldest, most commonly used data structures. ####What you need to know: Optimal for indexing; bad at searching, inserting, and deleting (except at the end). Linear arrays , or one dimensional arrays, are the most basic. Are static in size, meaning that they are declared with a fixed size. Dynamic arrays are like one dimensional arrays, but have reserved space for additional elements. If a dynamic array is full, it copies it's contents to a larger array. Two dimensional arrays have x and y indices like a grid or nested arrays. ####Big O efficiency: Indexing: Linear array: O(1), Dynamic array: O(1) Search: Linear array: O(n), Dynamic array: O(n) Optimized Search: Linear array: O(log n), Dynamic array: O(log n) Insertion: ...