0% found this document useful (0 votes)
36 views2 pages

Quiz#1 Solution Section A

The document contains 4 questions and answers about algorithms. An algorithm is defined as a program that determines the average of numbers, and must take inputs, return outputs, and have finite steps. Hard problems are those for which no efficient algorithm exists, such as the Hamiltonian problem. Linear algorithms search sequentially while non-linear algorithms search randomly, such as searching in an array versus a binary tree.

Uploaded by

Sohaib Azam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

Quiz#1 Solution Section A

The document contains 4 questions and answers about algorithms. An algorithm is defined as a program that determines the average of numbers, and must take inputs, return outputs, and have finite steps. Hard problems are those for which no efficient algorithm exists, such as the Hamiltonian problem. Linear algorithms search sequentially while non-linear algorithms search randomly, such as searching in an array versus a binary tree.

Uploaded by

Sohaib Azam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Quiz# 01

Question 1: Which of the following procedure can be


recognized as algorithm.

Answer:
Program that determine average of numbers can be recognized as
algorithm.

Question 2: What are the primitives characteristics for


procedure to be recognized as algorithm.

Answer:
A procedure must contain following characteristics:

It must take one or more inputs.


It must have to return at least one output.
It must consist of finite step.

Question 3: What are hard problems?

Answer:
There are some classic problems in computer word for which no
efficient algorithm is known. Such problems are known as hard problems. For
example, Hamiltonian problem.

Question 4: Difference between linear and nonlinear


algorithms.

Answer:
Linear Algorithms: A search algorithm is said to be linear if it
searches the required item sequencely. For example, searching in an array.
Non-Linear: A search algorithm is said to be non-linear if it searches
randomly for required item. For example, searching in a binary tree.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy