So, a data structure in which the task of inserting some new data between two data is done in the least time would be suitable for this purpose. In that case, using an array will lead to shifting the elements of the array or even making a new array of different size if the array is not large enough. For example, if we have a constant number of data and accessing the data in the least time is our priority, then an array is a suitable data structure because it can return the data at an index in constant time ($O(1)$).īut imagine a task in which we need to frequently insert some new data between two data. In computers also, the choice of the data structure depends upon the task we are going to perform. ![]() One can keep a frequently used book at the bottom of the pile of books and can access it with a little difficulty but it would make a lot more sense to keep frequently used books on the shelf to access them with ease. But in this course, every discussed data structure is made from scratch.ĭo we really need to worry about how our data is stored? Many programming languages also provide pre-built libraries for many data structure. There are many different data structures which are generally used. It is the most basic data structure and stores different data at different indices. In computers also, we have a similar scenario i.e., we can organize our data in the way we want and these different ways of organizing data are different data structures.įor example, an array is a type of data structure which we learn while learning basic programming languages. Thus, we have different options to organize books in a room or in different words, we have different structures to keep books. For example, think about organizing books in a room, we can keep those books on a shelf, or make a stack of them on a table or even just put them randomly anywhere in the room. So, let’s start.Ī data structure is a way we store and organize our data. In this very first chapter of data structures, we will focus on learning what basically is a data structure and why do we need it. It is also recommended that you first read those chapters before proceeding with this course. If you don’t know how to analyze the running time of code, you can read the first 7 chapters of the Algorithm Course. In this course, we will deal with different data structures, their applications, running times, etc. Data Structures and Algorithms (or DSA) is the most important course of any Computer Science program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |