Algorithms Answers

Questions answered by Experts: 652

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Create a pseudocode that will ask for the user for their First name, Middle name, and Last name. The program will next ask if it is morning or night, and then display a greeting with the user's complete name.
1. Study the following algorithm fragment, and answer the questions that follows.
declare a stack of characters
while (there are more characters in the word to read)
{
read a character;
push the character on the stack;
}
while (the stack is not empty)
{
pop a character off the stack;
write the character to the screen;
}
 If the input to the above algorithm is; {This is good time for DSA}
a. What is the value of top if the stack is full?
a. What will be the output of the algorithm for the given input
Identify the steps you would take to carry out each of the following operations on a linked-list data
structure and then implement an algorithm in pseudocode to solve problem as guided by the steps you
have identified.
1. Insert a new node at the beginning of a linked list
2. Delete the first node in a linked list
3. Write a program that counts the number of nodes in a linked list
4. Insert a new node at the end of a linked list.
5. Write a program that prints the contents of the linked list.
Identify the steps you would take to carry out each of the following operations on an array data
structure and then implement an algorithm in pseudocode to solve problem as guided by the steps you
have identified.
2. Write a function deleteLast() that accepts an array and Delete the last element in the array and display
the contents of an array after deletion operation.
3. Find an element x in an array and return the index of x, if found. Otherwise “print element x is not
in the list”.
4. Display the last 3 elements in the array
Identify the steps you would take to carry out each of the following operations on an array data
structure and then implement an algorithm in pseudocode to solve problem as guided by the steps you
have identified.
1. Insert an element into array data structure. Write appropriate message to indicate any condition
that may arise.

Create an algorithm, pseudocode and flowchart about this. Blog factory will give year end bonus. Employees that have monthly salary less than 300000, they will get 50% bonus of salary. While the greater than 30,000, they will get 20000. Print name and corresponding bonus for each employee


A. The Fibonacci numbers are the numbers in the following integer sequence.

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..

In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation. 

         Fn = F n-1 + F n-2


B. Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example, factorial of 6 is 6*5*4*3*2*1 which is 720.

         n! = n * (n - 1) * …….. 1 


 Write the algorithms to display the Fibonacci series and the factorial value for a given number using Pseudo code.


Define what an algorithm is and outline the characteristics of a good algorithm. Write the algorithms to display the Fibonacci series and the factorial value for a given number using Pseudo code. Determine the steps involved in the process of writing and executing a program.

Take a sample number and dry run the above two algorithms. Show the outputs at the end of each iteration and the final output. Examine what Big-O notation is and explain its role in evaluating efficiencies of algorithms. Write the Python program code for the above two algorithms and critically evaluate their efficiencies using Big-O notation.


A.   The Fibonacci numbers are the numbers in the following integer sequence.

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..

In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation. 

                 Fn = F n-1 + F n-2

B.   Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example, factorial of 6 is 6*5*4*3*2*1 which is 720.

                 n! = n * (n - 1) * …….. 1 



Create a pseudocode that will input values for A and B. Compare two values inputted and print which of the values is higher including the remark “Higher”.  


LATEST TUTORIALS
APPROVED BY CLIENTS