Data Structures
What are Data Structures & Algorithms A data structure is an arrangement of data in a computer’s memory (or sometimes on a disk). Data structures include arrays, linked lists, stacks, binary trees, and hash tables, among others. Algorithms manipulate the data in these structures in various ways, such as searching for a particular data item and sorting the data.
What sort of problems can be solved? Real-world data storage By real-world data, we mean data that describes physical entities external to the computer. As some examples, a personnel record describes an actual human being, How would you store, insert, delete, search and sort in quick way. Programmer’s tools A programmer uses such structures as tools to facilitate some other operation. Stacks, queues, and priority queues are often used in this way. Modeling The most important data structure of this type is the graph. You can use graphs to represent airline routes between cities or connections in an electric circuit or tasks in a project.
Overview of Data Structures Overview of Algorithm For most data structures, you need to know how to Insert a new data item. • Search for a specified item. • Delete a specified item. Overview of Data Structures
System Life Cycle Requirement Analysis Design Refinement and Coding Verification (testing and error removal)
Problems with Procedural Language Poor modeling of the real world Furnace-on(), furnace-of() –x-- thermostate Crude organizational units data could be local to a particular method, or it could be global—accessible to all methods (no concept of encapsulation or reusability)
OOP OOP is a method of implementation in which Objects are the fundamental building blocks Each object is instance of some type (class) Classes are related to each other by inheritence relationship Inheritance is the creation of one class, called the extended or derived class, from another class called the base class. The extended class has all the features of the base class, plus some additional features.
OOP Polymorphism involves treating objects of different classes in the same way. For polymorphism to work, these different classes must be derived from the same base class. In practice, polymorphism usually involves a method call that actually executes different methods for objects of different classes. Data encapsulation or information hiding is the concealing of the implementation details of a data object from the outside world. E.g we do not interact with circuits instead we only know RW, FW, Play
OOP Data Abstraction is the separation between the specification of a data object and its implementation. E.g manual makes clear distinction between the buttons of VCR. An abstract data type (ADT) is a data type that is organized in such a way that the specification of the objects and the specification of the operations on the objects is separated from the representation of the objects and implementation of the operations.