DATA STRUCTURES AND ALGORITHMS
DATA STRUCTURES AND ALGORITHMS - DEFINED Data structure  is an arrangement of data in a computer's memory or even disk storage. Examples : Arrays, lists, sets, queues, stacks, binary trees, hash tables, and graphs. Algorithms  are used to manipulate the data contained in these data structures as in searching and sorting. Many algorithms apply directly to a specific data structures. When working with certain data structures you need to know how to insert new data, search for a specified item, and deleting a specific item.
DATA STRUCTURES AND ALGORITHMS - DEFINED Commonly used algorithms include are useful for:  Searching for a particular data item (or record).  Sorting the data.  Iterating through all the items in a data structure. (Visiting each item in turn so as to display it or perform some other action on these items)
WHY DO WE NEED DATA STRUCTURES ?  Data structure is a particular way of storing and organizing information in a computer so that it can be retrieved and used most productively.  Each Data Structure allows data to be stored in specific manner.  Data Structure allows efficient data search and retrieval.  Specific Data structures are decided to work for specific problems.  It allows to manage large amount of data such as large databases and indexing services such as hash table. The choice of data structure and algorithm can make the difference between a program running in a few seconds or many days.
HOW TO SELECT DATA STRUCTURE? When selecting a data structure to solve a problem, you should follow these steps. 1. Analyze your problem to determine the basic operations that must be supported. Examples of basic operations include inserting a data item into the data structure, deleting a data item from the data structure, and finding a specified data item. 2. Quantify the resource constraints for each operation. 3. Select the data structure that best meets these requirements Some questions to ask:  Are all data inserted into the data structure at the beginning, or are insertions interspersed with other operations?  Can data be deleted?  Are all data processed in some well-defined order, or is random access allowed?
DATA STRUCTURE PHILOSOPHY 1. Each data structure has costs and benefits. 2. Rarely is one data structure better than another in all situations. 3. A data structure requires:  space for each data item it stores,  time to perform each basic operation,  programming effort. 4. Each problem has constraints on available space and time. 5. Only after a careful analysis of problem characteristics can we know the best data structure for the task.
ABSTRACT DATA TYPES  A type is a collection of values.  A data type is a type together with a collection of operations to manipulate the type.  A data item is a piece of information or a record whose value is drawn from a type. A data item is said to be a member of a type.  An abstract data type (ADT) is the specification of a data type within some language, independent of an implementation.  The interface for the ADT is defined in terms of a type and a set of operations on that type.  The behavior of each operation is determined by its inputs and outputs.  An ADT does not specify how the data type is implemented.  These implementation details are hidden from the user of the ADT and protected from outside access, a concept referred to as encapsulation.  A data structure is the implementation for an ADT.  In an object-oriented language, an ADT and its implementation together make up a class.  Each operation associated with the ADT is implemented by a member function or method.  The variables that define the space required by a data item are referred to as data members.  An object is an instance of a class, that is, something that is created and takes up storage during the execution of a computer program.
MOTIVATING QUOTATIONS “Every program depends on algorithms and data structures, but few programs depend on the invention of brand new ones.” -- Kernighan & Pike! “I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships.” -- Linus Torvalds!

Lesson 1 - Data Structures and Algorithms Overview.pdf

  • 1.
  • 2.
    DATA STRUCTURES ANDALGORITHMS - DEFINED Data structure  is an arrangement of data in a computer's memory or even disk storage. Examples : Arrays, lists, sets, queues, stacks, binary trees, hash tables, and graphs. Algorithms  are used to manipulate the data contained in these data structures as in searching and sorting. Many algorithms apply directly to a specific data structures. When working with certain data structures you need to know how to insert new data, search for a specified item, and deleting a specific item.
  • 3.
    DATA STRUCTURES ANDALGORITHMS - DEFINED Commonly used algorithms include are useful for:  Searching for a particular data item (or record).  Sorting the data.  Iterating through all the items in a data structure. (Visiting each item in turn so as to display it or perform some other action on these items)
  • 4.
    WHY DO WENEED DATA STRUCTURES ?  Data structure is a particular way of storing and organizing information in a computer so that it can be retrieved and used most productively.  Each Data Structure allows data to be stored in specific manner.  Data Structure allows efficient data search and retrieval.  Specific Data structures are decided to work for specific problems.  It allows to manage large amount of data such as large databases and indexing services such as hash table. The choice of data structure and algorithm can make the difference between a program running in a few seconds or many days.
  • 5.
    HOW TO SELECTDATA STRUCTURE? When selecting a data structure to solve a problem, you should follow these steps. 1. Analyze your problem to determine the basic operations that must be supported. Examples of basic operations include inserting a data item into the data structure, deleting a data item from the data structure, and finding a specified data item. 2. Quantify the resource constraints for each operation. 3. Select the data structure that best meets these requirements Some questions to ask:  Are all data inserted into the data structure at the beginning, or are insertions interspersed with other operations?  Can data be deleted?  Are all data processed in some well-defined order, or is random access allowed?
  • 6.
    DATA STRUCTURE PHILOSOPHY 1.Each data structure has costs and benefits. 2. Rarely is one data structure better than another in all situations. 3. A data structure requires:  space for each data item it stores,  time to perform each basic operation,  programming effort. 4. Each problem has constraints on available space and time. 5. Only after a careful analysis of problem characteristics can we know the best data structure for the task.
  • 7.
    ABSTRACT DATA TYPES A type is a collection of values.  A data type is a type together with a collection of operations to manipulate the type.  A data item is a piece of information or a record whose value is drawn from a type. A data item is said to be a member of a type.  An abstract data type (ADT) is the specification of a data type within some language, independent of an implementation.  The interface for the ADT is defined in terms of a type and a set of operations on that type.  The behavior of each operation is determined by its inputs and outputs.  An ADT does not specify how the data type is implemented.  These implementation details are hidden from the user of the ADT and protected from outside access, a concept referred to as encapsulation.  A data structure is the implementation for an ADT.  In an object-oriented language, an ADT and its implementation together make up a class.  Each operation associated with the ADT is implemented by a member function or method.  The variables that define the space required by a data item are referred to as data members.  An object is an instance of a class, that is, something that is created and takes up storage during the execution of a computer program.
  • 8.
    MOTIVATING QUOTATIONS “Every programdepends on algorithms and data structures, but few programs depend on the invention of brand new ones.” -- Kernighan & Pike! “I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships.” -- Linus Torvalds!