Data structures and Algorithms
Data structures and Algorithms At the heart of computer program design are two (sometimes conflicting) goals: -CORRECT ANSWER- To design an algorithm that is easy to understand, code and debug. To design an algorithm that makes efficient use of the computer's resources. Asymptotic Analysis -CORRECT ANSWER- A method for evaluating the efficiency of an algorithm or computer program. It also allows you to measure the inherent difficulty of a problem Efficient -CORRECT. ANSWER- A solution is said to be efficient if it solves the problem within the required resource constraints. Resource constraints. -CORRECT ANSWER- Examples of resource constraints include the total space available to store the data - possibly divided into separate main memory and disk space constraints - and the time allowed to perform each subtask. Cost -CORRECT ANSWER- The cost of a solution is the amount of resources that the solution consumes. Most often, cost is measured in terms of one key resource such as time, with the implied assumption that the solution meets the other resource constraints. When selecting a data structure to solve a problem you should follow these steps. -CORRECT ANSWER- 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. Quantify the resource constraints for each operation. Select the dats structure that best meets these requirements. Many issues relating to the relative importance of these operations are addressed by the following three questions, which you should ask yourself whenever you must choose a data structure: -CORRECT ANSWER- Are all data items inserted into the data structure at the beginning, or are insertions interspersed with other operations? Can data items be deleted? Are all data items processed in some well-defined order, or is search for specific data items allowed? Exact-match query. -CORRECT ANSWER- Records are accessible by unique account number. Range query. -CORRECT ANSWER- Users should also be able to find all places that match a particular value or range of values for attributes such as location or population size. Type -CORRECT ANSWER- A type is a collection of values. Simple type -CORRECT ANSWER- A simple type that contains no subparts. Aggregate type or composite type. -CORRECT ANSWER- A record that contains several pieces of information. Data item -CORRECT ANSWER- 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. Data type -CORRECT ANSWER- A data type is a type together with a collection of operations to manipulate the type. For example, an integer variable is a member of the integer data type. Addition is an example of an operation on the integer data type. Abstract data type -CORRECT ANSWER- An abstract data type is the realization of a data type as a software component. The interface of the ADT is defined in terms f a type and a set of operations on that type. The behavior of each operation is determined by its inputs and outputs. Encapsulation -CORRECT ANSWER- These implementation details are hidden from the user of the ADT and protected from outside access, a concept referred to as encapsulation. Data structure -CORRECT ANSWER- A data structure is the implementation for an abstract data type. Class -CORRECT ANSWER- In an object-oriented language such as Java, an abstract data type and its implementation together make up a class. Member function or method. -CORRECT ANSWER- Each operation associated with the abstract data type is implemented by a member function or method. Data members -CORRECT ANSWER- The variables that define the space required by a data item are referred to as data members. Object -CORRECT ANSWER- 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. File structure -CORRECT ANSWER- File structure often refers to the organization of data on peripheral storage, such as a disk drive or CD-ROM. Data types -CORRECT ANSWER- Data types have both a logical and a physical form. Design patterns. -CORRECT ANSWER- At a high level of abstraction than abstract data types are abstractions for describing the design of programs - that is, the interactions of objects and classes. Experienced software designers learn and reuse various techniques for combinin
Document information
- Uploaded on
- September 9, 2023
- Number of pages
- 3
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers