What is Class? What is Object?
From object-oriented point of view
Class is a user-defined data type which contains relevant data and functions
Object is a variable declared under some class data type
From philosophy concept
Class is an abstract concept that describes the attributes of a collection of objects
Minimum-Cost Spanning Tree weighted connected undirected graph
spanning tree
cost of spanning tree is sum of edge costs
find spanning tree that has minimum cost
u v G = (V,E)
V is the vertex set.
Vertices are also called nodes and points.
E is the edge set.
Each edge connects two different vertices.
Edges are also called arcs and lines.
Directed edge has an orientation (u,v).
u v G = (V,E)
V is the vertex set.
Vertices are also called nodes and points.
E is the edge set.
Each edge connects two different vertices.
Edges are also called arcs and lines.
Directed edge has an orientation (u,v).
Divide And Conquer A large instance is solved as follows:
Divide the large instance into smaller instances.
Solve the smaller instances somehow.
Combine the results of the smaller instances to obtain the result for the original large instance.
A small instance is solved in some other way.
Collection of items.
Each item is a pair.
(key, element)
Pairs have different keys.
Operations.
Search(Key,Element)
Insert(Element)
Delete(Key, Element)
The word item is used as a synonym for element to avoid the confusion that would otherwise result by saying that a dictionary is a collection of elements and each element is a pair (key, element).
A linear list is an ordered sequence of elements. A dictionary is just a collection of elements/items.
Interface Dictionary has these 3 methods.