|
Welcome to Softech
We Hope you get knowledge from here.
Science is mother of Nature
So try to help Nature by Technology
Here you get
All the stuff that you want and we also provide you The things that you want
So
Stay with us
Give us
Your feedback
Wednesday, 12 November 2014
post fix expression
data structure 2nd sessional course
Sessional course data structure:
v
Double link list( insertion , deletion , display)
v
Circular link list ( insertion , deletion , display)
v
Stack ( insertion , deletion , display)
v
Queue ( insertion , deletion , display)
v
Expression evaluation/polish notation(
infix,prefix,postfix)e.g table from diagram
v
Tree(theory)
v
Tree traversial.
Sunday, 9 November 2014
Cardinality of Relationships
Cardinality is the number of entity instances to which another entity
set can map under the relationship. This does not reflect a requirement
that an entity has to participate in a relationship. Participation is
another concept.
One-to-one: X-Y is 1:1 when each entity in X is associated with at most one entity in Y, and each entity in Y is associated with at most one entity in X.
One-to-many: X-Y is 1:M when each entity in X can be associated with many entities in Y, but each entity in Y is associated with at most one entity in X.
Many-to-many: X:Y is M:M if each entity in X can be associated with many entities in Y, and each entity in Y is associated with many entities in X (“many” =>one or more and sometimes zero)
One-to-one: X-Y is 1:1 when each entity in X is associated with at most one entity in Y, and each entity in Y is associated with at most one entity in X.
One-to-many: X-Y is 1:M when each entity in X can be associated with many entities in Y, but each entity in Y is associated with at most one entity in X.
Many-to-many: X:Y is M:M if each entity in X can be associated with many entities in Y, and each entity in Y is associated with many entities in X (“many” =>one or more and sometimes zero)
Keys in DBMS
Super key: An attribute or set of attributes that uniquely identifies an entity–there can be many of these
Composite key:A key requiring more than one attribute
Candidate key: a superkey such that no proper subset of its attributes is also a superkey (minimal superkey – has no unnecessary attributes)
Primary key: The candidate key chosen to be used for identifying entities and accessing records. Unless otherwise noted “key” means “primary key”
Alternate key: A candidate key not used for primary key
Secondary key: Attribute or set of attributes commonly used for accessing records, but not necessarily unique
Foreign key: An attribute that is the primary key of another table and is used to establish a relationship with that table where it appears as an attribute also.
Composite key:A key requiring more than one attribute
Candidate key: a superkey such that no proper subset of its attributes is also a superkey (minimal superkey – has no unnecessary attributes)
Primary key: The candidate key chosen to be used for identifying entities and accessing records. Unless otherwise noted “key” means “primary key”
Alternate key: A candidate key not used for primary key
Secondary key: Attribute or set of attributes commonly used for accessing records, but not necessarily unique
Foreign key: An attribute that is the primary key of another table and is used to establish a relationship with that table where it appears as an attribute also.
Entities and Attributes
Entity Type:It is a set of
similar objects or a category of entities that are well defined
- A rectangle represents an entity set
- Ex: students, courses
- We often just say “entity” and mean “entity type”
Attribute:It describes one
aspect of an entity type; usually [and best when] single valued and indivisible
(atomic)
- Represented by oval on E-R diagram
- Ex: name, maximum enrollment
Types of Attribute:
Simple and Composite
Attribute
Simple attribute that consist of a single atomic value.A simple
attribute cannot be subdivided. For example the attributes age, sex etc are
simple attributes.
A composite attribute is an attribute that can be further
subdivided. For example the attribute ADDRESS can be subdivided into street,
city, state, and zip code.
Simple Attribute: Attribute that consist of a single atomic value.
Example: Salary, age etc
Composite Attribute
: Attribute value not atomic.
Example : Address : ‘House_no:City:State
Name : ‘First Name: Middle Name: Last Name’
Example : Address : ‘House_no:City:State
Name : ‘First Name: Middle Name: Last Name’
Single Valued and Multi
Valued attribute
A single valued attribute can have only a single value. For example
a person can have only one ‘date of birth’, ‘age’ etc. That is a single valued
attributes can have only single value. But it can be simple or composite
attribute.That is ‘date of birth’ is a composite attribute , ‘age’ is a simple
attribute. But both are single valued attributes.
Multivalued attributes can have multiple values. For instance a
person may have multiple phone numbers,multiple degrees etc.Multivalued
attributes are shown by a double line connecting to the entity in the ER diagram.
Single Valued Attribute: Attribute that hold a single value
Example1: Age
Exampe2: City
Example3:Customer id
Example1: Age
Exampe2: City
Example3:Customer id
Multi Valued Attribute: Attribute that hold multiple values.
Example1: A customer can have multiple phone numbers, email id’s etc
Example2: A person may have several college degrees
Example1: A customer can have multiple phone numbers, email id’s etc
Example2: A person may have several college degrees
Stored and Derived
Attributes
The value for the derived attribute is derived from the stored
attribute. For example ‘Date of birth’ of a person is a stored attribute. The
value for the attribute ‘AGE’ can be derived by subtracting the ‘Date of
Birth’(DOB) from the current date. Stored attribute supplies a value to the
related attribute.
Stored Attribute: An attribute that supplies a value to the related
attribute.
Example: Date of Birth
Example: Date of Birth
Derived Attribute: An attribute that’s value is derived from a
stored attribute.
Example : age, and it’s value is derived from the stored attribute Date of Birth.
Example : age, and it’s value is derived from the stored attribute Date of Birth.
Concepts of Entity Relationship Diagram( ER diagram)
Entity Relationship Model:
An Entity – Relationship model (ER model) is an abstract way to describe a database. It is a visual representation of different data using conventions that describe how these data are related to each other.There are three basic elements in ER models:
- Entities are the “things” about which we seek information.
- Attributes are the data we collect about the entities.
- Relationships provide the structure needed to draw information from multiple entities.
- Entity – rectangle
- Attribute -oval
- Relationship – diamond
- Link - line
C++ Double Ended Queues
Constructors | create new deques |
Operators | compare and assign deques |
assign() | set the values of the deque |
at() | returns a specific element |
back() | returns the last element |
begin() | returns an iterator to the first element |
clear() | remove all elements |
empty() | true if the deque is empty |
end() | returns an iterator to the end of the queue |
erase() | removes an element |
front() | returns the first element |
get_allocator() | returns the deque's allocator |
insert() | insert elements into the deque |
max_size() | returns the maximum elements that the deque can hold |
pop_back() | removes the last element |
pop_front() | removes the first element |
push_back() | add an element to the end of the deque |
push_front() | add an element to the front of the deque |
rbegin() | returns a reverse iterator to the end of the deque |
rend() | returns a reverse iterator to the beginning of the deque |
resize() | change the size of the deque |
size() | return the number of elements in the deque |
swap() | swap one deque with another |