Search This Blog

Wednesday, May 26, 2010

Converting Synchrous BPEL process to Asynchronous BPEL process in soa


This article is about how to convert a synchronous BPEL process to an asynchronous one.

Whenever we create new bpel process three files are created by default viz.

  • [processName].bpel
  • [processName].wsdl
  • bpel.xml

But the difference between the Synchronous and Asynchronous process remains in the .bpel and .wsdl files only.

If we open the .bpel and .wsdl file of both the processes we do not find much difference in the two therefore it's very easy to convert an asynchronous process to synchronous one and vice-versa.

For explaining how to convert the synchronous process to asynchronous one I have created a BPEL process SynchBP. I’ll be converting SynchBP which is a Synchronous BPEL process to an asynchronous one. As earlier said the difference is only in .bpel and .wsdl file so we'll concentrate only on these two files.

For ease of understanding I have used colours in the text so as to highlight what to change and what to add.

So, first start with SynchBP.bpel file.

There are three places where we have to make changes viz. partnerlink, receive, and reply element.

Partnerlink:

This is how the partnerlink element is of a SynchBP:

Add another attribute partnerRole="SynchBPRequester" to this element. The partnerlink will look like this:

partnerRole="SynchBPRequester"/>

Receive Element:

Below is the receive element of SynchBP

operation="process" variable="inputVariable"

createInstance="yes"/>

Change the value of attribute operation from process to initiate. The partnerlink will look like this:

operation="initiate" variable="inputVariable" createInstance="yes"/>

Reply element:

Below is the reply element of SynchBP

<reply name="replyOutput" partnerLink="client" portType="client:SynchBP" operation="process" variable="outputVariable"/>

Do the following changes to make it for asynchronous process:

  • Change the element name from reply to invoke.
  • Change the name attribute value from replyOutput to callbackClient.
  • Change the value of attribute portType from client:SynchBP to client:SynchBPCallback (or simply [processName]Callback ).
  • Change operation=”process” to operation=”onResult”.
  • Change the name of last attribute i.e. variable to inputvariable.

<invoke name="callbackClient" partnerLink="client" portType="client:SynchBPCallback" operation="onResult" inputVariable="outputVariable"/>

Here we are done with SynchBP.bpel, now we need to edit SynchBP.wsdl.

There are very few changes to be made in the .wsdl file.

The elements that need to be changed are portType and partnerLinkType.

portType:

This is how a portType is defined in a synchronous process:

"process">

Create another portType element with name SynchronousProcessCallback and operation as onResult. Now delete the output element from both portTypes and in the SynchronousProcessCallback portType, change the attribute value from client:SynchBPRequestMessage to client:SynchBPResponseMessage. (Help: Copy & paste the already defined portType and do as below)

"initiate">

……Remove this

"onResult">

……. Remove this

<input message="client:SynchBPResponseMessage"/>

partnerLinkType:

This is how partnerlink information is provided in a wsdl of a synchronous process:

Inside partnerLinkType create one more role element and give it a name as SynchronousProcessRequester. Now inside the role element for portType element change the value of name attribute to client:SynchronousProcessCallback.

Here we are done with .wsdl file and the SynchBP process is now an asynchronous BPEL Process.

Monday, May 3, 2010

Usefull RUN commands!!!




Accessibility Controls - access.cpl
Add Hardware Wizard - hdwwiz.cpl
Add/Remove Programs - appwiz.cpl
Administrative Tools - control admintools
Automatic Updates - wuaucpl.cpl
Bluetooth Transfer Wizard - fsquirt
Calculator - calc
Certificate Manager - certmgr.msc
Character Map - charmap
Check Disk Utility - chkdsk
Clipboard Viewer - clipbrd
Command Prompt - cmd
Component Services - dcomcnfg
Computer Management - compmgmt.msc
Date and Time Properties - timedate.cpl
DDE Shares - ddeshare
Device Manager - devmgmt.msc
Direct X Control Panel (If Installed)* - directx.cpl
Direct X Troubleshooter - dxdiag
Disk Cleanup Utility - cleanmgr
Disk Defragment - dfrg.msc
Disk Management - diskmgmt.msc
Disk Partition Manager - diskpart
Display Properties - control desktop
Display Properties - desk.cpl
Display Properties (w/Appearance Tab Preselected) - control color
Dr. Watson System Troubleshooting Utility - drwtsn32
Driver Verifier Utility - verifier
Event Viewer - eventvwr.msc
File Signature Verification Tool - sigverif
Findfast - findfast.cpl
Folders Properties - control folders
Fonts - control fonts
Fonts Folder - fonts
Free Cell Card Game - freecell
Game Controllers - joy.cpl
Group Policy Editor (XP Prof) - gpedit.msc
Hearts Card Game - mshearts
Iexpress Wizard - iexpress
Indexing Service - ciadv.msc
Internet Properties - inetcpl.cpl
IP Configuration (Display Connection Configuration) - ipconfig /all
IP Configuration (Display DNS Cache Contents) - ipconfig /displaydns
IP Configuration (Delete DNS Cache Contents) - ipconfig /flushdns
IP Configuration (Release All Connections) - ipconfig /release
IP Configuration (Renew All Connections) - ipconfig /renew
IP Configuration (Refreshes DHCP & Re - Registers DNS) – ipcon

IP Configuration (Display DHCP Class ID) - ipconfig /showclassid
IP Configuration (Modifies DHCP Class ID) - ipconfig /setclassid
Java Control Panel (If Installed) - jpicpl32.cpl
Java Control Panel (If Installed) - javaws
Keyboard Properties - control keyboard
Local Security Settings - secpol.msc
Local Users and Groups - lusrmgr.msc
Logs You Out Of Windows - logoff
Microsoft Chat - winchat
Minesweeper Game - winmine
Mouse Properties - control mouse
Mouse Properties - main.cpl
Network Connections - control netconnections
Network Connections - ncpa.cpl
Network Setup Wizard - netsetup.cpl
Notepad - notepad
Nview Desktop Manager (If Installed) - nvtuicpl.cpl
Object Packager - packager
ODBC Data Source Administrator - odbccp32.cpl
On Screen Keyboard - osk
Opens AC3 Filter (If Installed) - ac3filter.cpl
Password Properties - password.cpl
Performance Monitor - perfmon.msc
Performance Monitor - perfmon
Phone and Modem Options - telephon.cpl
Power Configuration - powercfg.cpl
Printers and Faxes - control printers
Printers Folder - printers
Private Character Editor - eudcedit
Quicktime (If Installed) - QuickTime.cpl
Regional Settings - intl.cpl
Registry Editor - regedit
Registry Editor - regedit32
Remote Desktop - mstsc
Removable Storage - ntmsmgr.msc
Removable Storage Operator Requests - ntmsoprq.msc
Resultant Set of Policy (XP Prof) - rsop.msc
Scanners and Cameras - sticpl.cpl
Scheduled Tasks - control schedtasks
Security Center - wscui.cpl
Services - services.msc
Shared Folders - fsmgmt.msc
Shuts Down Windows - shutdown
Sounds and Audio - mmsys.cpl
Spider Solitare Card Game - spider
SQL Client Configuration - cliconfg
System Configuration Editor - sysedit
System Configuration Utility - msconfig
System File Checker Utility (Scan Immediately) - sfc /scannow
System File Checker Utility (Scan Once At Next Boot) - sfc /scanonce
System File Checker Utility (Scan On Every Boot) - sfc /scanboot
System File Checker Utility (Return to Default Setting) - sfc /revert
System

System File Checker Utility (Purge File Cache) - sfc /purgecache
System File Checker Utility (Set Cache Size to size x) - sfc /cachesize=x
System Properties - sysdm.cpl
Task Manager - taskmgr
Telnet Client - telnet
User Account Management - nusrmgr.cpl
Utility Manager - utilman
Windows Firewall - firewall.cpl
Windows Magnifier - magnify
Windows Management Infrastructure - wmimgmt.msc
Windows System Security Tool - syskey
Windows Update Launches - wupdmgr
Windows XP Tour Wizard - tourstart
Wordpad - write

Thursday, April 29, 2010

Career Options after 12th

Career Options after 12th Science and Commerce:
· Careers in Advertising
· Careers in Fire Engineering
· Careers in Music
· Careers in Aeronautical / Aerospace Engineering
· Careers in Air Force (As Officer)
· Careers in Forensic Science
· Careers in Nursing
· Careers in Forestry Wildlife
· Careers in Nutrition and Dietetics
· Careers in Airhostess/Pursers
· Careers in Genetic Engineering
· Careers in Oceanography
· Careers in Ayurveda
· Careers in Gemmology
· Careers in Occupational Therapy
· Careers in Bio-Technology
· Careers in Hotel industry
· Careers in Pharmacy
· Careers in Call Centres
· Careers in Indian Army
· Careers in Photography
· Careers in Chartered Accountancy
· Careers in Interior Designing
· Careers in Physiotherapy
· Careers in Civil Engineering
· Careers in ICWAI
· Careers in Psychiatry
· Careers in Journalism/Mass Communication
· Careers in Psychology
· Careers in Commercial Pilot
· Careers in Law
· Careers in Public Relation
· Careers in Company Secretary
· Careers in Librarianship
· Careers in Teaching
· Careers in Tea Management
· Careers in Dance
· Careers in Mechanical Engineering
· Careers in Dairy
· Careers in Medical Transcription
· Careers in Travel and Tourism
· Careers in Dentistry
· Careers in Medical Lab Technology
· Careers in Veterinary Science
· Careers in Electronic Engineering
· Careers in Medicine
· Careers in Video Jockey
· Careers in Fashion Technology
· Careers in Merchant Navy
· Careers in Film Making
· Career in Modeling

COMMON INTERVIEW QUESTIONS AND ANSWERS

1. Tell me about yourself:
The most often asked question in interviews. You need to have a short statement prepared
in your mind. Be careful that it does not sound rehearsed. Limit it to work-related items
unless instructed otherwise. Talk about things you have done and jobs you have held that
relate to the position you are interviewing for. Start with the item farthest back and work up
to the present.
2. Why did you leave your last job?
Stay positive regardless of the circumstances. Never refer to a major problem with
management and never speak ill of supervisors, co-workers or the organization. If you do,
you will be the one looking bad. Keep smiling and talk about leaving for a positive reason
such as an opportunity, a chance to do something special or other forward-looking reasons.
3. What experience do you have in this field?
Speak about specifics that relate to the position you are applying for. If you do not have
specific experience, get as close as you can.
4. Do you consider yourself successful?
You should always answer yes and briefly explain why. A good explanation is that you have
set goals, and you have met some and are on track to achieve the others.
5. What do co-workers say about you?
Be prepared with a quote or two from co-workers. Either a specific statement or a
paraphrase will work. Jill Clark, a co-worker at Smith Company, always said I was the
hardest workers she had ever known. It is as powerful as Jill having said it at the interview
herself.
6. What do you know about this organization?
This question is one reason to do some research on the organization before the interview.
Find out where they have been and where they are going. What are the current issues and
who are the major players?
7. What have you done to improve your knowledge in the last year?
Try to include improvement activities that relate to the job. A wide variety of activities can
be mentioned as positive self-improvement. Have some good ones handy to mention.
8. Are you applying for other jobs?
Be honest but do not spend a lot of time in this area. Keep the focus on this job and what
you can do for this organization. Anything else is a distraction.
9. Why do you want to work for this organization?
This may take some thought and certainly, should be based on the research you have done
on the organization. Sincerity is extremely important here and will easily be sensed. Relate
it to your long-term career goals.
10. Do you know anyone who works for us?
Be aware of the policy on relatives working for the organization. This can affect your answer
even though they asked about friends not relatives. Be careful to mention a friend only if
they are well thought of.
11. What kind of salary do you need?
A loaded question. A nasty little game that you will probably lose if you answer first. So, do
not answer it. Instead, say something like, That's a tough question. Can you tell me the
range for this position? In most cases, the interviewer, taken off guard, will tell you. If not,
say that it can depend on the details of the job. Then give a wide range.
12. Are you a team player?
You are, of course, a team player. Be sure to have examples ready. Specifics that show you
often perform for the good of the team rather than for yourself are good evidence of your
team attitude. Do not brag, just say it in a matter-of-fact tone. This is a key point.
13. How long would you expect to work for us if hired?
Specifics here are not good. Something like this should work: I'd like it to be a long time. Or
As long as we both feel I'm doing a good job.
14. Have you ever had to fire anyone? How did you feel about that?
This is serious. Do not make light of it or in any way seem like you like to fire people. At the
same time, you will do it when it is the right thing to do. When it comes to the organization
versus the individual who has created a harmful situation, you will protect the organization.
Remember firing is not the same as layoff or reduction in force.
15. What is your philosophy towards work?
The interviewer is not looking for a long or flowery dissertation here. Do you have strong
feelings that the job gets done? Yes. That's the type of answer that works best here. Short
and positive, showing a benefit to the organization.
16. If you had enough money to retire right now, would you?
Answer yes if you would. But since you need to work, this is the type of work you prefer. Do
not say yes if you do not mean it.
17. Have you ever been asked to leave a position?
If you have not, say no. If you have, be honest, brief and avoid saying negative things
about the people or organization involved.
18. Explain how you would be an asset to this organization
You should be anxious for this question. It gives you a chance to highlight your best points
as they relate to the position being discussed. Give a little advance thought to this
relationship.
19. Why should we hire you?
Point out how your assets meet what the organization needs. Do not mention any other
candidates to make a comparison.
20. Tell me about a suggestion you have made
Have a good one ready. Be sure and use a suggestion that was accepted and was then
considered successful. One related to the type of work applied for is a real plus.
21. What irritates you about co-workers?
This is a trap question. Think real hard but fail to come up with anything that irritates you.
A short statement that you seem to get along with folks is great.
22. What is your greatest strength?
Numerous answers are good, just stay positive. A few good examples:
Your ability to prioritize, Your problem-solving skills, Your ability to work under pressure,
Your ability to focus on projects, Your professional expertise, Your leadership skills, Your
positive attitude .
23. Tell me about your dream job.
Stay away from a specific job. You cannot win. If you say the job you are contending for is
it, you strain credibility. If you say another job is it, you plant the suspicion that you will be
dissatisfied with this position if hired. The best is to stay genetic and say something like: A
job where I love the work, like the people, can contribute and can't wait to get to work.
24. Why do you think you would do well at this job?
Give several reasons and include skills, experience and interest.
25. What are you looking for in a job?
See answer # 23
26. What kind of person would you refuse to work with?
Do not be trivial. It would take disloyalty to the organization, violence or lawbreaking to get
you to object. Minor objections will label you as a whiner.
27. What is more important to you: the money or the work?
Money is always important, but the work is the most important. There is no better answer.
28. What would your previous supervisor say your strongest point is?
There are numerous good possibilities:
Loyalty, Energy, Positive attitude, Leadership, Team player, Expertise, Initiative, Patience,
Hard work, Creativity, Problem solver
29. Tell me about a problem you had with a supervisor
Biggest trap of all. This is a test to see if you will speak ill of your boss. If you fall for it and
tell about a problem with a former boss, you may well below the interview right there. Stay
positive and develop a poor memory about any trouble with a supervisor.
30. What has disappointed you about a job?
Don't get trivial or negative. Safe areas are few but can include:
Not enough of a challenge. You were laid off in a reduction Company did not win a contract,
which would have given you more responsibility.
31. Tell me about your ability to work under pressure.
You may say that you thrive under certain types of pressure. Give an example that relates
to the type of position applied for.
32. Do your skills match this job or another job more closely?
Probably this one. Do not give fuel to the suspicion that you may want another job more
than this one.
33. What motivates you to do your best on the job?
This is a personal trait that only you can say, but good examples are:
Challenge, Achievement, Recognition
34. Are you willing to work overtime? Nights? Weekends?
This is up to you. Be totally honest.
35. How would you know you were successful on this job?
Several ways are good measures:
You set high standards for yourself and meet them. Your outcomes are a success.Your boss
tell you that you are successful
36. Would you be willing to relocate if required?
You should be clear on this with your family prior to the interview if you think there is a
chance it may come up. Do not say yes just to get the job if the real answer is no. This can
create a lot of problems later on in your career. Be honest at this point and save yourself
future grief.
37. Are you willing to put the interests of the organization ahead of your own?
This is a straight loyalty and dedication question. Do not worry about the deep ethical and
philosophical implications. Just say yes.
38. Describe your management style.
Try to avoid labels. Some of the more common labels, like progressive, salesman or
consensus, can have several meanings or descriptions depending on which management
expert you listen to. The situational style is safe, because it says you will manage according
to the situation, instead of one size fits all.
39. What have you learned from mistakes on the job?
Here you have to come up with something or you strain credibility. Make it small, well
intentioned mistake with a positive lesson learned. An example would be working too far
ahead of colleagues on a project and thus throwing coordination off.
40. Do you have any blind spots?
Trick question. If you know about blind spots, they are no longer blind spots. Do not reveal
any personal areas of concern here. Let them do their own discovery on your bad points. Do
not hand it to them.
41. If you were hiring a person for this job, what would you look for?
Be careful to mention traits that are needed and that you have.
42. Do you think you are overqualified for this position?
Regardless of your qualifications, state that you are very well qualified for the position.
50 Common Interview Questions and Answers
© JobsAssist.com (www.jobsassist.com ) and VyomWorld.com (www.vyomworld.com ) – Free Student Resources
43. How do you propose to compensate for your lack of experience?
First, if you have experience that the interviewer does not know about, bring that up: Then,
point out (if true) that you are a hard working quick learner.
44. What qualities do you look for in a boss?
Be generic and positive. Safe qualities are knowledgeable, a sense of humor, fair, loyal to
subordinates and holder of high standards. All bosses think they have these traits.
45. Tell me about a time when you helped resolve a dispute between others.
Pick a specific incident. Concentrate on your problem solving technique and not the dispute
you settled.
46. What position do you prefer on a team working on a project?
Be honest. If you are comfortable in different roles, point that out.
47. Describe your work ethic.
Emphasize benefits to the organization. Things like, determination to get the job done and
work hard but enjoy your work are good.
48. What has been your biggest professional disappointment?
Be sure that you refer to something that was beyond your control. Show acceptance and no
negative feelings.
49. Tell me about the most fun you have had on the job.
Talk about having fun by accomplishing something for the organization.
50. Do you have any questions for me?
Always have some questions prepared. Questions prepared where you will be an asset to
the organization are good. How soon will I be able to be productive? and What type of
projects will I be able to assist on? are examples.

Algorithm Complexity

Algorithm Complexity
Written and composed by Laurent Haan
http://www.progressive-coding.com
Introduction to Algorithm Complexity
[...] an algorithm is a procedure (a finite set of well-defined
instructions) for accomplishing some task which, given an initial state,
will terminate in a defined end-state. The computational complexity and
efficient implementation of the algorithm are important in computing,
and this depends on suitable data structures.
Wikipedia: http://en.wikipedia.org/wiki/Algorithm
In Computer Science, it is important to measure the quality of algorithms, especially the
specific amount of a certain resource an algorithm needs. Examples of such resources
would be time or memory storage. Nowadays, memory storage is almost a non-essential
factor when designing algorithms but be aware that several systems still have memory
constraints, such as Digital Signal Processors in embedded systems.
Different algorithms may complete the same task with a different set of instructions in
less or more time, space or effort than other. The analysis and study of algorithms is a
discipline in Computer Science which has a strong mathematical background. It often
relies on theoretical analysis of pseudo-code.
To compare the efficiency of algorithms, we don't rely on abstract measures such as the
time difference in running speed, since it too heavily relies on the processor power and
other tasks running in parallel. The most common way of qualifying an algorithm is the
Asymptotic Notation, also called Big O.
Asymptotic Notation
The symbol O is used to describe an asymptotic upper bound for the magnitude of a
function in terms of another, simpler function.
This means that for x > k, when x tends to infinity, the value f(x) will always be inferior
to C *g(x) (with C a constant).
The idea behind this notation is that it allows us to qualify to efficiency of an algorithm by
telling us how often a certain algorithm will execute operations before terminating. Let's
start with a simple example:
void f ( int a[], int n )
{
int i;
printf ( "N = %d\n", n );
for ( i = 0; i < i =" 0;" i =" 0;" mid =" (" n =" mid;"> x )
i = mid + 1;
else
return mid;
}
return 0;
}
We can call this an O(N) algorithm and not be wrong because the time complexity will
never exceed O(N). But because the array is split in half each time, the number of steps
is always going to be equal to the base-2 logarithm of N, which is considerably less than
O(N). So an even better choice would be to set the upper bound to log N, which is the
upper limit that we know we're guaranteed never to cross. Therefore, a more accurate
claim is that binary search is a logarithmic, or O(log2 N), algorithm.
Bubble Sort
A sorting algorithm is an algorithm that puts elements of a list in a certain order. The
most used orders are numerical or lexicographical order. There exist numerous sort
algorithms and there efficiency vary greatly!
Bubble sort is a straightforward and simplistic method of sorting data that is used in
computer science education. The algorithm starts at the beginning of the data set. It
compares the first two elements, and if the first is greater than the second, it swaps
them. It continues doing this for each pair of adjacent elements to the end of the data
set. It then starts again with the first two elements, repeating until no swaps have
occurred on the last pass. Although simple, this algorithm is highly inefficient and is
rarely used except in education. For sorting small numbers of data (e.g. 20) it is better
than Quicksort.
void bubbleSort(int *array, int size)
{
int swapped = 0;
int x;
do
{
swapped = 0;
for (x = 0; x <>array[x+1])
{
swap(&array[x], &array[x+1]);
swapped = 1;
}
}
} while (swapped);
}
1. What is the worst case performance ?
2. What is the best case performance ?
3. Can you think of a way to improve the performance ?
Selection Sort
Selection sort is a simple sorting algorithm that improves on the performance of bubble
sort. It works by first finding the smallest element using a linear search and swapping it
into the first position in the list, then finding the second smallest element by scanning
the remaining elements, and so on. Selection sort is unique compared to almost any
other algorithm in that its running time is not affected by the prior ordering of the list, it
performs the same number of operations because of its simple structure.
void selectionSort(int *array, int size)
{
int x,y,min;
for (x = 0; x < min =" x;" y="x+1;" if="">< min =" y;" x =" 0;">= 0 && array[pos] > value)
{
array[pos+1] = array[pos];
pos--;
}
array[pos+1] = value;
}
1. What is the worst case performance ?
2. What is the best case performance ?
3. Can you think of a way to improve the performance ?
Heap Sort
Heapsort is a much more efficient version of Selection Sort. It also works by determining
the largest (or smallest) element of the list, placing that at the end (or beginning) of the
list, then continuing with the rest of the list, but accomplishes this task efficiently by
using a data structure called a heap, a special type of binary tree. Once the data list has
been made into a heap, the root node is guaranteed to be the largest element. It is
removed and placed at the end of the list, then the heap is rearranged so the largest
element remaining moves to the root . Using the heap, finding the next largest element
takes O(log n) time, instead of O(n) for a linear scan as in simple selection sort. This
allows Heapsort to run in O(n log n) time.
Merge Sort
Merge sort takes advantage of the ease of merging already sorted lists into a new sorted
list. It starts by dividing the list into two sublists which are then sorted again with Merge
Sort. This continues until the size of the list equals one (which is sorted). Then it merges
those sublists again into bigger lists and only a few simple steps are required to merge
two sorted lists.
function mergesort(m, start, end)
if length(m) ≤ 1
return m
else
middle = start+end / 2
left = mergesort(m, start, middle)
right = mergesort(m, middle,end)
result = merge(left, right)
return result
Since Merge Sort is a recursive implementation working on two independent sublists, it
can be efficiently implemented in parallel using threads. The speed gain of a parallel
execution is doubled on dual core processors.
Quick Sort
Quicksort is a divide and conquer algorithm, which relies on a partition operation: to
partition an array, we choose an element, called a pivot, move all smaller elements
before the pivot, and move all greater elements after it. This can be done efficiently in
linear time and in-place. We then recursively sort the lesser and greater sublists. Efficient
implementations of quicksort (with in-place partitioning) are somewhat complex, but are
among the fastest sorting algorithms in practice. Together with its modest O(log n) space
usage, this makes quicksort one of the most popular sorting algorithms, available in
many standard libraries. The most complex issue in quicksort is choosing a good pivot
element; consistently poor choices of pivots can result in drastically slower (O(n2))
performance, but if at each step we choose the median as the pivot then it works in O(n
log n).
Exercise: Stone Age boulders
Two stone age men have gathered an impressive collection of boulders in their cave, all
of different size and weight, standing neatly one after the other, in the order they have
been collected. To restore some order in the room, they want to arrange the boulders
from the smallest to the largest, with the smallest at the entrance of the cave and the
largest close to the back wall.
Each boulder is only represented by its weight, so the heavier it is, the largest it is (we
assume that they are all made of the same material). As there are only 2 stone age men,
and the space inside the cave is limited, they are only allowed to swap two boulders at a
time. Additionally, to save their energy, they want to use a method that allows them to
move the minimum necessary weight only.
Write an algorithm that takes an array of boulders and orders it from the smallest to the
largest, by only swapping two boulders at a time but with the least effort in terms of kilos
moved.
Example:
{5, 3, 1}
-> {1, 3, 5} and necessary effort: 1+5 = 6
{6, 4, 1, 2}
-> {6, 1, 4, 2}, effort 5
-> {6, 2, 4, 1}, effort 3
-> {1, 2, 4, 6}, effort 7
total effort: 15

LISTS OF FIRST IN INDIA


Architecture

Awards and Titles

Nobel Prize

Defence

Exploration

Film and TV

Governance

1st woman speaker of lok sabha-- shanno devi

Science

Sport

Olympics

Chess

Female - Koneru Humpy - 2002 - She was also the youngest woman to become a grandmaster at 15 years old.

Tennis

Cricket

Women

Sport

Administration and Politics

Places

Transport

Others

Graduate in Medicine: Soorjo Coomar Goodeve Chuckerbutty