Docsity

Introduction to Data Structures and Algorithms, Exams of Data Structures and Algorithms

Toggle sidebar
bg1
Introduction to Data
Structures and Algorithms
Abstract Data Types - ANS-specification of a set of data and set of operations
performed in a data
-storage for data defined in terms of set of operations to be performed on the
data
algorithm - ANSThis is an Example of a simple ______.
-Apply to wet hair
-Massage gently
-Leave on for a few moments
-Rinse Off
Algorithms - ANS-finite set of instructions that specify a sequence of
operations to be carried out
-recipe for solving a problem
-all the tasks that can be carried out by a computer
Analysis of Algorithms - ANS-determining the amount of resources necessary
to
execute it such as time and storage
-usually in terms of CPU time and memory requirements
Array, Linked list, Stacks, Trees, Hast tables - ANSWhat are the 5 Types of
Data Structures?
pf3
pf4

Partial preview of the text

Download Introduction to Data Structures and Algorithms and more Exams Data Structures and Algorithms in PDF only on Docsity!

Introduction to Data

Structures and Algorithms

Abstract Data Types - ANS-specification of a set of data and set of operations performed in a data -storage for data defined in terms of set of operations to be performed on the data algorithm - ANSThis is an Example of a simple ______. -Apply to wet hair -Massage gently -Leave on for a few moments -Rinse Off Algorithms - ANS-finite set of instructions that specify a sequence of operations to be carried out -recipe for solving a problem -all the tasks that can be carried out by a computer Analysis of Algorithms - ANS-determining the amount of resources necessary to execute it such as time and storage -usually in terms of CPU time and memory requirements Array, Linked list, Stacks, Trees, Hast tables - ANSWhat are the 5 Types of Data Structures?

Average-case analysis - ANSanalysis where all possible inputs and calculate computing time for all of the inputs. Sum all the calculated values and divide the sum by total number of inputs. We must know (or predict) distribution of cases Best-case analysis - ANS-is used in to describe an algorithm's behavior under optimal conditions. For example, the best case for a simple linear search on a list occurs when the desired element is the first element of the list.

  • Less widely found data structure - ANS-specialized format to store and organize data in a computer's memory or disk -collection of variables, possibly of several different data types connected in various ways Data Types - ANS-data that a variable can hold in a programming language -all programming language has a set of built-in data types Definiteness - ANSeach instruction must be clear and unambiguous Effectiveness - ANSeach operation must be definite, but must also be feasible Finiteness - ANSall instructions of an algorithm will terminate after a finite number of steps Input - ANS-zero or more quantities are externally supplied

-The last phase of refinement results in a program ready to be coded for execution. Worst-case analysis - ANS-it is typically impossible to determine the exact worst-case scenario. Instead, a scenario is considered such that it is at least as bad as the worst case. For example, when analyzing an algorithm, it may be possible to find the longest possible path through the algorithm