Why study data structures and algorithms? z. Programs solve problems z. Programs process information z. Information needs to be organized ÕData structures z. Programs carry out tasks ÕAlgorithms z. Data structures and algorithms need to be correct and efficient
Terms z. Type – a collection of values z. Data Type – a type together with a collection of operations to manipulate the type z. Abstract Data Type (ADT) – defines a data type solely in terms of a type and a set of operations on that type z. Data Structure – the physical implementation of the ADT
Data Structures and OOP Principles z. Data Structures are Objects z. Abstraction (ability to distill a software system into its most basic parts) and Encapsulation (implementing the abstraction without revealing how is applies to Data Structures z. Inheritance and Polymorphism implemented) ÕData Structures are often “containers” and share similar operations
More terms z. Problem – a function or an association of inputs with outputs. z. Algorithm – a recipe for solving a problem whose steps are concrete and unambiguous z. Program – an instantiation of an algorithm in a computer programming language
Properties of an algorithm z. It must be correct. z. It must be composed of a series of concrete steps. z. There has to be no ambiguity. z. It must be composed of a finite number of steps. z. It must terminate.