CC4 - chapter 1 and 2 Flashcards
– machine that manipulates data.
Computer
–Concealing of the implementation details of data object from the outside world
Data encapsulation / information hiding
– separation between specification of a data object and its implementation
Data abstraction
– a collection of objects and set of operations that act on those objects
Data type
– storing and organizing data in a computer so that it can be used efficiently.
Data structure
– may be organized in many different
Data
CHARACTERISTICS OF ALGORITHM
- Provides description of elements in terms of data types
- Defines the relationship among individual
Elements - Valid operations and parameters to be passed
- Error conditions associated with the operations
DATA STRUCTURE OPERATIONS
- traversing
- searching
- inserting
- deleting
– accessing each record exactly once so that certain items in the record may be processed.
Traversing – retrieving/visiting
– finding the location of the record
Searching – insert
– adding new records to the structure.
Inserting – update
– removing
Deleting – remove
– used by os, Compilers, dbms, data communications
data structure/+ algorithms
– its elements form a sequence
- Array
- Stack – lifo
- Queue – fifo
- Linked list
Linear data structure
– represent data containing a hierarchical relationship between elements
- Tree & graph
Non-linear data structure
Quick insertion, very fast access if
Slow search, Slow deletion, index is known, Fixed size
Arrays
Quicker search than unsorted array. Slow insertion and deletion, Fixed size
Ordered Array
Provides last-in first-out access Slow access to other items
Stack
Provides first-in first-out access Slow access to other items
Queue
Quick insertion and quick deletion Slow search
Linked List
Quick search, insertion and Deletion algorithm is deletion if tree remains balance complex.
Binary Trees
Very fast access if key known, Fast Slow deletion, access slow if key not known, inefficient memory usage
Hash Table
Fast insertion, deletion. Access to Slow access to other items
Heap
Models real world situation Some algorithms are slow access.
Graph
Algorithm – finite set of instructions that takes some raw data as input and transforms it in to refined data.
Algorithm
ALGORITHM STEPS
- input
- output
- definiteness
- finiteness
- effectiveness
– zero or more quantities are externally supplied
Input
– at least one quantity is produced
Output
– each instruction is clear and unambiguous
Definiteness
– algorithm terminates after a fi nite number of steps
Finiteness
– every instruction must be basic enough to be carried out
Effectiveness
COMMON TYPES OF ALGORITHM
- searching
- sorting
- compression
- fast Fourier transforms
- encoding
- geometric
- pattern matching
- parsing
– search for a given item in large data collection
Searching