write an algorithm to illustrate 10 to x if x<y otherwise 5 is assigned to x.
Write an algorithm and pseudocode to compute f(x)=1+x+x^2+x^3+....+x^n
An algorithm is written to take as input the number of miles travelled. The algorithm works out how much this will cost, with each mile costing £0.30 in petrol. If this is greater than £10.00 then it is reduced by 10%.
miles = input("Enter the number of miles)
cost = 0.3
if cost = 10 then
cost = cost * 0.1
endif
print(cost)
There are four errors in this algorithm. Identify each error and correct it.
A salesman wants to travel among 4 or n cities. He wishes to visit maximum or all cities in one day. The order of visiting different cities is not important, but his point of consideration is to minimize distance travelled. In a map this scenario can be described in this way; Cities are represented by nodes, and distance is represented as edges.
Suppose he starts travel from source city ‘A’, visit different cities in the following ways:
A->C->B->D
A->D->C->B
A->B->D->C
you have to choose a suitable algorithm from the following list of algorithms which you think is the best algorithm for the salesman to cover maximum cities by traveling minimum distance.
Suppose he starts travel from source city ‘A’, visit different cities in the following ways:
Considering the above scenario, you have to choose a suitable algorithm from the following list of algorithms which you think is the best algorithm for the salesman to cover maximum cities by traveling minimum distance.
we know that the tabular computation of a dynamic- programming algorithm helps us to avoid recomputation. prove it using the example of fibonacci numbers.
· Case 1: Text categorization: Spam Detection.
· Case 2: Face detection.
· Case 3: Signature recognition.
· Case 4: Customer discover.
· Case 5: Medicine: Classify if a patient has heart ischemia by a spectral analysis of his/her ECG.
Find one (1) of the secondary datasets from the internet. Name the secondary dataset that you have found.
When can we use greedy algorithm?
programmer in an IT firm. Your firm got a project to develop an
application for an Ice Cream Parlor. The application must be developed considering the
following scenario.
• The application will display a menu showing the flavors that have been offered by the Ice
Cream Parlor.
• The Parlor offers Tutti-Frutti, Chocolate, Pineapple, Kulfa, Strawberry, Mango, Orange,
and Pistachio flavors.
• The price of each flavor per scoop has been listed in the table below, for multiple scoops,
the price will variate as per the scenario stated in the table.
Flavor
Price Per Scoop
One Scoop Two
Scoops
Three Scoops or
above
Tutti-Frutti 150 120 100
Chocolate 150 120 100
Pine Apple 150 120 100
Kulfa 150 120 100
Strawberry 150 120 100
Mango 175 150 130
Orange 200 170 150
Pistachio 150 120 100
• The developed application will ask the customer to select the flavors and no. of scoops
for each selected flavor. The program will perform calculations and display the bill.
You are required to write the pseudo-code for the above-given scenario
Consider the following two sample codes in different language for software complexity analysis using Halstead matrics. Calculate the length, vocabulary, volume, difficulty, Effort, time, and number of delivered Bugs of each code. Create a comparison chart of time, Effort, bugs, and difficulty using any language