Sie sind auf Seite 1von 8

1. Define an algorithm.

An algorithm is a finite set of instructions that, if followed, accomplishes a


particular task

2. What is space complexity?

The space complexity of an algorithm is the amount of memory it needs to


run to completion.

3. What is time complexity?

The time complexity of an algorithm is the amount of computer time it


needs

to run to completion

4. How can you specify Algorithms?


Algorithms can be specified natural language or pseudo code.

5. What is Pseudo Code?


Pseudo Code is a mixture of Natural Language and Programming Language
Constructs such as functions, loops, decision making statements..etc

6. Write a short note on Algorithm Design and Analysis of Process.


o Understand the problem
o Decide on Computational Device Exact Vs Approximate Algorithms
o Algorithm Design Techniques
o Design an algorithms
o Prove Correctness
o Analyze the Algorithm
o Code the Algorithm

7. How can you Classify Algorithms


Among several ways to classify algorithms, the 2 principal alternatives are
• To group algorithms according to types of problem they solve com
• To group algorithms according to underlying design techniques they are
based upon.
8. Write the advantages of Flowchart.
• Communication: Flowcharts are better way of communicating the logic of a
system to all concerned or involved.
• Effective analysis: With the help of flowchart, problem can be analysed in more
effective way therefore reducing cost and wastage of time.
• Proper documentation: Program flowcharts serve as a good program
documentation, which is needed for various purposes, making things more
efficient.
• Efficient Coding: The flowcharts act as a guide or blueprint during the systems
analysis and program development phase.
• Proper Debugging: The flowchart helps in debugging process.
• Efficient Program Maintenance: The maintenance of operating program
becomes easy with the help of flowchart. It helps the programmer to put efforts
more efficiently on that part

9. Write the disadvantages of Flowchart.

• Complex logic: Sometimes, the program logic is quite complicated. In that case,
flowchart becomes complex and clumsy. This will become a pain for the user,
resulting in a waste of time and money trying to correct the problem
• Alterations and Modifications: If alterations are required the flowchart may
require re-drawing completely. This will usually waste valuable time.
• Reproduction: As the flowchart symbols cannot be typed, reproduction of
flowchart becomes a problem.
10. Write the Characteristics of an Algorithm
 Unambiguous

 Input

 Output

 Effectiveness

 Feasibility
 Precision

 Independent

11.Write the Qualities of a good Algorithm


1. Time .
2. Memory
3. Accuracy
4. Sequence
5. Generability

12. List the various method for specifying an algorithm.


Algorithms can be expressed in many kinds of notation, including

 natural languages

 pseudo code,
 flowcharts

 drakon-charts

 programming languages or

 control tables (processed by interpreters).

13. List the Uses of Algorithm

Algorithms are often used for


 Calculation
 Data processing and
14. What are the advantages of algorithm?

1. It is a step-wise representation of a solution to a given problem, which


makes it easy to understand.
2. An algorithm uses a definite procedure.
3. It is not dependent on any programming language, so it is easy to
understand for anyone even without programming knowledge.
4. Every step in an algorithm has its own logical sequence so it is easy to
debug.
5. By using algorithm, the problem is broken down into smaller pieces or
steps hence, it is easier for programmer to convert it into an actual program
15. What are the disadvantages of algorithm?

1. Writing algorithm takes a long time.


2. An Algorithm is not a computer program; it is rather a concept of how
a program should be.
16. What are the advantages of Pseudo code?

o Reduced complexity.

o Increased flexibility.

o Ease of understanding.

o Can be done easily on a word processor.

o Easily modified.

o Pseudocode is compact and does not tend to run over many pages.

o Language Independent.

17. What are the disadvantages of Pseudo Code?


o Pseudo code does not provide visual representation of the program’s
logic.

o No accepted standards style of writing pseudo codes.

o Cannot be compiled or executed and there are no real formatting or


syntax rules.

18. List the types of flowchart?

Types of flowchart

Four general types of flowchart are

 Document flowcharts
 Data flowcharts
 System flowcharts

 Program flowchart

19.List the Uses of flowchart

 Planning a new project


 Documenting a process
 Modeling a business process
 Managing workflow
 Auditing a process
 Mapping computer algorithms
 Data management
20.How the programming language can be classified?
1. Machine level language
2. Assembly level language
3. High- Level Language

21.Define Machine level language.

Machine language is a set of instructions executed directly by a computer's central


processing unit (CPU)

22. What is algorithmic?

The study of algorithms is called algorithmic. It is more than a branch of computer science. It is the core of
computer science and is said to be relevant to most of science, business and technology.

23. Why is the need of studying algorithms?

From a practical standpoint, a standard set of algorithms from different areas of computing must be known,
in addition to be able to design them and analyze their efficiencies. From a theoretical standpoint the study of
algorithms is the cornerstone of computer science
24. What is an algorithm design technique?

An algorithm design technique is a general approach to solving problems algorithmically that is applicable
to a variety of problems from different areas of computing.

25. What are the types of algorithm efficiencies? The two types of algorithm efficiencies are Time
efficiency: indicates how fast the algorithm runs Space efficiency: indicates how much extra memory the algorithm
needs

26. Give the diagram representation of Notion of algorithm.

Problem

Algorithm

Input Output
“Computer

27. What are the steps involved in the analysis framework? The various steps are as follows Measuring the
input‘s size Units for measuring running time Orders of growth Worst case, best case and average case
efficiencies
28. . What are the features of efficient algorithm? • Free of ambiguity • Efficient in execution time • Concise
and compact Completeness • Definiteness Finiteness

22.Differentiate recursion and iteration algorithm.

RECURSION ITERATIONS
Recursive function – is a function that Iterative Instructions –are loop based
is partially defined by itself repetitions of a process
Recursion Uses selection structure Iteration uses repetition structure
Infinite recursion occurs if the An infinite loop occurs with iteration
recursion step does not reduce the if the loop-condition test never
problem in a manner that converges on becomes false
some condition.(base case)
Recursion terminates when a base case Iteration terminates when the loop-
is recognized condition fails
Recursion is usually slower then Iteration does not use stack so it's
iteration due to overhead of faster than recursion
maintaining stack
Recursion uses more memory than Iteration consume less memory
iteration
Infinite recursion can crash the infinite looping uses CPU
system cycles repeatedly
Recursion makes code smaller Iteration makes code longer

Das könnte Ihnen auch gefallen