Sunday, 25 October 2015
Friday, 23 October 2015
SORTING PROGRAMS (INSERTION SORT,MARGE SORT, QUICK SORT, SHELL SORT}
SORTING PROGRAMS (INSERTION SORT,MARGE SORT, QUICK SORT, SHELL SORT}
Posted on
- WAP to sort array of integers using insertion sort.
#include<iostream.h>
#include<conio.h>
void main(){
clrscr();
inti,k,j,n,t,a[20];
cout<<“Enter number of elements:”;
cin>>n;
cout<<“Enter unsorted elements:\n”;
for(i=0;i<n;i++){
cin>>a[i];
}
for(k=1;k<n;k++){
t=a[k];
j=k-1;
while((j>=0)&&(t<a[j]))
{
a[j+1]=a[j];
j–;
}
a[j+1]=t;
}
cout<<“Elements after sorting\n”;
for(j=0;j<n;j++){
cout<<a[j]<<” “;
}
getch();
}
- WAP to sort array of integers using merge sort.
#include<iostream.h>
#include<conio.h>
voidmergesort(int *,int,int);
void merge(int *,int,int,int);
int a[20],i,n,b[20];
void main()
{
clrscr();
cout<<“Enter no of elements:”;
cin>> n;
cout<<“Enter elements:”;
for(i=0;i<n;i++)
cin>> a[i];
mergesort(a,0,n-1);
cout<<“\nNumbers after sort:”;
for(i=0;i<n;i++)
cout<< a[i] << ” “;
getch();
}
voidmergesort(int a[],inti,int j)
{
int mid;
if(i<j)
{
mid=(i+j)/2;
mergesort(a,i,mid);
mergesort(a,mid+1,j);
merge(a,i,mid,j);
}
}
void merge(int a[],intlow,int mid ,int high)
{
inth,i,j,k;
h=low;
i=low;
j=mid+1;
while(h<=mid && j<=high)
{
if(a[h]<=a[j])
b[i]=a[h++];
else
b[i]=a[j++];
i++;
}
if( h > mid)
for(k=j;k<=high;k++)
b[i++]=a[k];
else
for(k=h;k<=mid;k++)
b[i++]=a[k];
cout<<“\n”;
for(k=low;k<=high;k++)
{ a[k]=b[k];
cout<< a[k] <<” “;
}
}
- WAP to sort array of integers using quick sort.
#include<iostream.h>
#include<conio.h>
int a[10],l,u,i,j;
void quick(int *,int,int);
void main()
{
clrscr();
cout<<“Enter 10 elements:\n”;
for(i=0;i<10;i++)
cin>> a[i];
l=0;
u=9;
quick(a,l,u);
cout<<“\nSorted elements:”;
for(i=0;i<10;i++)
cout<< a[i] << ” “;
getch();
}
void quick(int a[],intl,int u)
{
intp,temp;
if(l<u)
{
p=a[l];
i=l;
j=u;
while(i<j)
{
while(a[i] <= p && i<j )
i++;
while(a[j]>p && i<=j )
j–;
if(i<=j)
{
temp=a[i];
a[i]=a[j];
a[j]=temp;}
}
temp=a[j];
a[j]=a[l];
a[l]=temp;
cout<<“\n”;
for(i=0;i<10;i++)
cout<<a[i]<<” “;
quick(a,l,j-1);
quick(a,j+1,u);
}}
- WAP of shell sort.
#include<iostream.h>
#include<conio.h>
void read(int a[10],int n)
{
cout<<“Enter elements:\n”;
for(int i=0;i<n;i++)
cin>>a[i];
}
void display(int a[10],int n)
{
for(int i=0;i<n;i++)
cout<<a[i]<<“\t”;
}
voidshellsort(int a[10],int n)
{
int gap=n/2;
do
{
int swap;
do
{
swap=0;
for(int i=0;i<n-gap;i++)
if(a[i]>a[i+gap])
{
int t=a[i];
a[i]=a[i+gap];
a[i+gap]=t;
swap=1;
}
}
while(swap);
}
while(gap=gap/2);
}
void main()
{
int a[10];
int n;
clrscr();
cout<<“Enter number of elements:”;
cin>>n;
read(a,n);
cout<<“Before sorting\n”;
display(a,n);
shellsort(a,n);
cout<<“\nAfter sorting\n”;
display(a,n);
getch();
}
Monday, 19 October 2015
Burj Khalifa (برج خليفة)
Burj Khalifa (Arabic: برج خليفة,
"Khalifa Tower", pronounced English /ˈbɜrdʒ kəˈliːfə/),
known as Burj Dubai before its inauguration, is a megatall skyscraper in Dubai, United Arab Emirates. It is the tallest artificial structure in the
world, standing at 829.8 m (2,722 ft).
Construction of Burj Khalifa
began in 2004, with the exterior completed in 2009. The primary structure is
reinforced concrete. The building opened in 2010, as part of the new
development called Downtown Dubai.
It is designed to be the centerpiece of large-scale, mixed-use development. The
decision to build the building is reportedly based on the government's decision
to diversify from an oil-based economy, and for Dubai to gain international
recognition. The building was named in honor of the ruler of Abu Dhabi and president of the United Arab
Emirates, Khalifa bin Zayed Al Nahyan; Abu Dhabi and the UAE government lent
Dubai money to pay its debts. The building broke numerous height records.
Burj Khalifa was designed by
Skidmore, Owings and Merrill (SOM), who also designed the Willis Tower and the One World Trade Center, with Hyder
Consulting chosen to be the supervising engineer with NORR Group Consultants
International Limited chosen to supervise the architecture of the project. The
design of Burj Khalifa is derived from patterning systems embodied in Islamic architecture, incorporating
cultural and historical elements particular to the region such as the spiral
minaret. The Y-shaped plan is designed for residential and hotel usage. A
buttressed core structural system is used to support the height of the
building, and the cladding system is designed to withstand Dubai's summer
temperatures. A total of 57 elevators and 8 escalators are installed, with the
elevators having a capacity of 12 to 14 people per cabin.
Critical reception to Burj Khalifa
has been generally positive, and the building received many awards. However,
the labor issues during construction have been controversial, since the
building was built primarily by workers from South Asia and East Asia, who
earned low wages and were reportedly housed in poor conditions.
History of height
Burj
Khalifa compared with some other well-known tall structures
There are unconfirmed reports
of several planned height increases since its inception. Originally proposed as
a virtual clone of the 560 m (1,837 ft) Grollo Tower proposal for Melbourne, Australia's Docklands waterfront development, the
tower was redesigned by Skidmore, Owings and Merrill (SOM). Marshall Strabala, an SOM architect
who worked on the project until 2006, in late 2008 said that Burj Khalifa was
designed to be 808 m (2,651 ft) tall.
The design architect, Adrian
Smith, felt that the uppermost section of the building did not culminate
elegantly with the rest of the structure, so he sought and received approval to
increase it to the current height.It has been explicitly stated that this
change did not include any added floors, which is fitting with Smith's attempts
to make the crown more slender.
Features
The Dubai Fountain
The Dubai Fountain
Main
article: The Dubai Fountain
Outside, WET Enterprises designed a fountain system at a cost of
Dh 800 million (US$217 million). Illuminated by 6,600 lights and
50 coloured projectors, it is 275 m (902 ft) long and shoots water
150 m (490 ft) into the air, accompanied by a range of classical to
contemporary Arabic and world music. On 26 October 2008, Emaar announced that
based on results of a naming contest the fountain would be called the Dubai
Fountain.
Observation deck
An outdoor observation deck, named At the Top, opened on 5 January
2010 on the 124th floor. At 452 m (1,483 ft), it was the highest
observation deck in the world and the highest outdoor observation deck in the
world when it opened. Although it was surpassed in December 2011 by Cloud Top 488 on the Canton Tower at 488 m (1,601 ft), Burj Khalifa opened the 148th floor
SKY level at 555 m (1,821 ft), once again giving it the highest
observation deck in the world on 15 October 2014.[The
124th floor observation deck also features the Tellscope electronic telescope,
an augmented reality device developed by gsmprjct° of Montréal, which allows visitors to view the surrounding landscape
in real-time, and to view previously saved images such as those taken at
different times of day or under different weather conditions. To manage the
daily rush of sightseers, visitors are able to purchase tickets in advance for
a specific date and time and at a 75% discount over tickets purchased on the
spot.
On 8 February 2010, the
observation deck was closed to the public after power-supply problems caused an
elevator to become stuck between floors, trapping a group of tourists for 45
minutes. Despite rumours of the
observation deck reopening for St. Valentine's Day (14 February), it remained closed until 4 April 2010.
Burj Khalifa park
Burj Khalifa is surrounded by
an 11 ha (27-acre) park designed by landscape architects SWA Group. The design of the park is also inspired by
the core design concepts of Burj Khalifa which is based on the symmetries of
the desert flower, Hymenocallis. The park has six water features, gardens,
palm lined walkways, and flowering trees. At
the centre of the park and the base of Burj Khalifa is the water room, which is
a series of pools and water jet fountains. In addition the railing, benches and
signs incorporate images of Burj Khalifa and the Hymenocallis flower.
The plants and the shrubbery will be
watered by the buildings's condensation collection system that uses water from
the cooling system. The system will provide 68,000,000 L
(15,000,000 imp gal) annually. WET
Enterprises, who also developed the Dubai Fountain, developed the park's six water features.
Floor plans
Inside the burj khalifa
thanks......
Sunday, 18 October 2015
Eating tips
Eating tips
A healthy diet should include a wide variety of
nutritious foods for sufficient intake of all nutrients, including vitamins and
minerals. Foods to include are breads, pastas, lean meats, fish, fruits and
vegetables. A healthy diet can help you maintain a healthy body weight and
decrease your risk of many diet-related chronic diseases, such as
cardiovascular disease, type 2 diabetes and some cancers.
Healthy diets in variety of foods
In general, we should include a range of nutritious foods and eat:
·
plenty of breads and
cereals (particularly wholegrain), fruit, vegetables and legumes (such as
chickpeas, lentils and red kidney beans)
·
low-salt foods, and use
salt sparingly
·
small amounts of foods
that contain added sugars
·
reduced-fat milk and
other dairy products.
It is also important to drink an
adequate amount of water.
Physical activity and eating
A good balance between exercise and food intake is important, as this helps to maintain muscle strength and a healthy body weight. At least 30 minutes of moderate intensity physical activity, such as walking, is recommended every day.
Keep fat to less
Adult diets should be low in fat, especially saturated fat. Saturated fat, which is the main fat in animal products, fried foods, chocolate, cakes and biscuits, is more easily deposited as fat tissue than unsaturated fat. Saturated fat can also be converted into cholesterol and cause blood cholesterol levels to rise.
Dietary fat helps with the absorption of fat-soluble vitamins (A, D, E and K). Small amounts of polyunsaturated and monounsaturated fats may have some health benefits when they are part of a healthy diet. Monounsaturated fats are found in nuts, olive oil and avocados, and may help to lower the bad type of cholesterol (low-density lipoprotein or LDL).
Polyunsaturated fats are generally thought to lower blood cholesterol levels. Polyunsaturated omega-3 fatty acids, which are found in fish, nuts and seeds, are thought to have an anti-clotting effect on blood, to reduce the risk of heart disease and to possibly lower blood pressure.
Consume less high-kilojoules foods
The total amount of energy-dense (high-kilojoule) foods you eat may be as important as the total amount of fat in your diet. To reduce the energy density of your diet, you need to increase the amount of plant foods, such as wholegrain breads and cereals, fruit and vegetables that you eat.
This will provide essential nutrients, help to make you feel ‘full’ and also reduce the amount of fat in your diet. High energy drinks such as sports drinks, cordials, soft drinks, fruit juice, energy drinks should also be limited.
Eat foods rich in calcium and iron
It is important for all Australians to eat foods which contain iron and calcium. In particular:
·
Calcium – is important for bone health especially for infants,
women and girls.
·
Iron – carries oxygen around the body and is especially
important for women, girls, vegetarians and athletes to reduce the risk of
anaemia.
Drink alcohol in moderation
Alcohol is high in energy (kilojoules) and should be consumed in moderation. Men should drink less than two standard drinks per day and women less than one standard drink per day. One standard drink is 375 ml mid-strength beer, 100 ml wine or 30 ml spirits. Alcohol should not be given to children and is not recommended for pregnant or breastfeeding women.
diets for babies and children
There are guidelines to follow that help encourage a healthy diet for your infant or child, including:
·
Infants – it is encouraged for babies to be breastfed for the
first year of life. In most cases, breastfeeding should be the only source of
food in the first six months. If you use formula, be careful not to overfeed or
underfeed your baby.
·
Sugar – children should eat only a small amount of foods that
contain sugar and avoid food with added sugar, such as lollies, fruit drinks
and soft drinks.
·
Low-fat diets – are not appropriate for infants and young children
under two years of age. A diet low in fat, especially saturated fat, may be
considered for older children.
·
Drinks – infants and children should be encouraged to choose
water as their preferred drink.
Don’t skip breakfast
Children who skip breakfast generally have poorer nutrition. Their diets contain less:
·
calcium
·
iron
·
dietary fibre
·
vitamins such as
riboflavin and niacin.
Skipping breakfast becomes more
common as children get older. Some schools have introduced breakfast programs
because they were concerned about children who skip breakfast. Children
generally perform better at school when they have breakfast. They are also more
likely to maintain a healthy weight when they consume a healthy breakfast.
Adults who eat a healthy breakfast are more likely be a healthy weight and more productive at work.
Adults who eat a healthy breakfast are more likely be a healthy weight and more productive at work.
Healthy breakfasts
Some easy-to-prepare, healthy breakfast ideas include:
·
fresh fruit with wholegrain breakfast cereal and reduced fat milk.
Toast with a thin spread of margarine (polyunsaturated or monounsaturated)
·
toast with cheese and tomato. Hot or cold reduced fat milk
·
rolled oats made with quick oats. Add sultanas and reduced fat milk.
Toast with a thin spread of margarine (polyunsaturated or monounsaturated).
Orange juice
·
baked beans on toast. Orange juice
·
fruit or plain yoghurt with fruit.
Things to remember
·
A wide variety of foods
is important for good health.
·
Calcium and iron are
important nutrients in our diets.
·
Infants and young
children should not be placed on low-fat diets.
·
Encourage infants and
children to choose water as their preferred drink.
·
Children will have better
nutrition and do better at school if they eat breakfast.
·
Be physically active.
Subscribe to:
Posts (Atom)