615 vues

Transféré par Arun Karthik

- A Notes on Design & Analysis of Algorithm
- CS502_all
- root
- ln1ntroduction
- full notes
- daa 1mark questions and answers
- daa
- DAA Tutorials
- Design and Analysis of Algorithms
- Introduction to Lisp
- Technical
- adaNotes-1
- Intro Notes
- Algorithm Analysis and Design
- Venkatesh Raman - Algo Notes
- CLRS - Elements of Greedy Strategy
- Problems on Algorithms (2002)
- DAA
- CS2251-QB
- David Mount - Algorithm Notes Good

Vous êtes sur la page 1sur 30

COIMBATORE – 35

UNIT – I

time

2. What is an algorithm?

particular task.

1) Input

2) Output

3) Definiteness

4) Finiteness

5) Effectiveness

4. Define Program.

synonymously

program.

Step do

<statement 1>

<statement n >

to be

to run

to completion.

8. What is time complexity?

needs

to run to completion.

The best-case step count is the minimum number of steps that can be

executed

The worst-case step count is the maximum number of steps that can be

instances

The function f(n) = O(g(n)) iff there exist positive constants C and no such

that f(n)£ C * g(n) for all n, n ³n0.

The function f(n) =W (g(n)) iff there exist positive constant C and no such

that

The function f(n) =q (g(n)) iff there exist positive constant C1, C2, and no

n - μ g(n)

iff

Lim f(n) = 0

n - μ g(n)

numbers.

Algorithm sum(a,n)

S : = 0.0

For i=1 to n do

S : - S + a[i];

Return S;

numbers.

If(n_ 0) then

Return 0.0;

Constant:1

Logarithmic: log n

Linear: n

N-log-n: n log n

Quadratic: n2

Cubic: n3

Exponential:2n

Factorial:n!

22. Define Time Space Tradeoff.

Time and space complexity can be reduced only to certain levels, as later

on

Time-space

trade-off.

If the program is run on a large data set, then the running time

becomes an

issue.

24. List the factors which affects the running time of the

algorithm.

A. Computer

B. Compiler

C. Algorithm used

function in

26. What is classification of the recurrence equation?

1. Homogeneous

2. Inhomogeneous

12 mark Questions

Unit I

1. Define the asymptotic notations used for best case average case and

worst case

analysis of algorithms.

best , worst

worst and

average

algorithms.

10. Find the complexity (C (n))of the algorithm for the worst case, best

inputs)

UNIT II

strategy

suggests splitting the inputs in to’k’ distinct susbsets, 1<k <n, yielding ‘k’

be found

are still

reapplied.

but

undefined.

Algorithm D And(r)

else

One of the methods for solving any such recurrence relation is called the

substitution method.

If ‘q’ is always chosen such that ‘aq’ is the middle element(that is,

search.

The computing time of binary search by giving formulas that describe the

best,

average and worst cases. Successful searches q(1) q(logn) q(Logn) best

average worst

SNSCT – Department of Compute Science and Engineering Page 7

of all

The internal path length ‘I’ is the sum of the distances of all internal nodes

The problem is to find the maximum and minimum items in a set of ‘n’

allows us to

n quicksort, the division into subarrays is made so that the sorted sub

arrays do

operations is of

though for large ‘n’ its computing time is O(n2).

minimum>

for i = 2 to n do

T(n) = g(n)

Algorithm BinSearch(a,n,x)

{

low : = 1;

high : = n;

mid : = [(low+high)/2];

return 0;

computing

n = 1, a a constant

T(n) = a

Given n inputs and we are required to form a subset such that it satisfies

some

19. Write any two characteristics of Greedy Algorithm?

set of

candidates.

o As the algorithm proceeds, two other sets get accumulated among this

one set

contains the candidates that have been already considered and chosen

while

the other set contains the candidates that have been considered but

rejected.

function

A bag or sack is given capacity n and n objects are given. Each object has

0<=xi<=1 .If

fraction is 1 then entire object is put into sack. When we place this

A directed binary tree for which each edge is labeled with a real number

In places where the loss exceeds the tolerance level boosters have to the

placed. Given a network and loss tolerance level the tree vertex splitting

problems is

but it

choice

that looks best at that moment. A given ‘n’ inputs are required us to

obtain a subset

method suggests

that one can device an algorithm that works in stages considering one

input at a time.

Determine the optimal substructure of the problem.

greedy

choice.

Show that all but one of the sub problems induced by having made the

greedy

The ‘n’ task will be given with starting time si and finishing time fi.

Feasible

Solution is that the task should not overlap and optimal solution is that

V_ vertex set

E_ edge set

W is more commonly denoted as w (i,j) which is the weight of the edge

<i,j> _

E.

Collection of sub trees that are obtained when root node is eliminated is

known as forest

Given a set of ‘n’ jobs each job ‘i’ has a deadline di such that di>=0

and a

Processing the job on the machine is for 1unit of time. Only one

machine is

available.

The order in which the TVSP visits the nodes of the tree is called the post

order traversal.

32. Write the formula to calculate delay and also write the

To calculate delay

d(u)=max{d(v)+w(u, v)}

v _ c(u)

d(u)+w(u ,v)>_ and also d(u) is set to zero.

The network can tolerate the losses only up to a certain limit tolerance

limit.

A task is said to be late in any schedule if it finishes after its deadline else

abstraction.

solution=0;

for i=1 to n do

x= select(a);

if feasible(solution ,x) then

solution=Union(solution ,x);

return solution;

sequencing

with deadlines.

Dynamic programming.

generated. generated1.

12 mark Questions

Unit II

1. Sort the following set of elements using Quick Sort. (24,8,71, 4,23,6)

3. Write an algorithm for searching an element using binary search

Method, Give an

example.

Prim's algorithm.

UNIT III

when a

recomputing

their values.

not

considered.

3. What are the drawbacks of dynamic programming?

Time and space requirements are high, since storage is needed for all

level.

sequence of 4 steps.

whenever

regard to

to

We have

to decide the value of xi for 1<i<n. First we make a decision on x1 and

then on x2

obtain one merged file. When more than 2 files are to be merged

merge

pattern tells which pair of files should be merged at each step. An optimal

sequence

is to

decide which vertex should be the second, which is the third, which is the

fourth, and

that results

The solution to the knapsack problem can be viewed as a result of

sequence of

value 0 or 1

maximum Spi

capacity.

knapsack problem?

g0(m)=max{g1, g1(m-w1)+p1}.

includes every vertex in V. The cost of a tour is the sum of the cost of the

edges on

cost.

sites.

an

assembly line.

Production environment in which several commodities are

manufactured on

salesperson

problem.

flow shop we have n jobs each requiring n tasks i.e. T1i, T2i,…...Tmi,

1<i<n.

Let Tji denote jth task of the ith job. Task Tij is to be performed on Pj

number of

number of

task

No processor can have more than one task assigned to it at any time.

processing the task for j>1 cannot be started until T(j-i),i has been

completed.

on

any

The finish time fi (S) of job i is the time at which all tasks of job i have

been

F(S)=max{ fi

(S)} 1<i<n

n 1<i<n

S.

21. Define preemptive optimal finish time.

schedules S.

22. What are the requirements that are needed for performing

Backtracking?

To solve any problem using backtracking, it requires that all the solutions

i. Explicit constraints.

They are rules that restrict each xi to take on values only from a give set.

They

depend on the particular instance I of the problem being solved. All tuples

that

They are rules that determine which of the tuples in the solution space of I

satisfy the criteria function. It describes the way in which the xi must

relate to

each other.

The tree organization of the solution space is referred to as state space

tree.

All the paths from the root of the organization tree to all the nodes is

called as

Answer states are those solution states s for which the path from the root

to s

being

being

A node which has been generated and all of whose children have not yet

been

31. Define a E – node.

E – node (or) node being expanded. Any live node whose children are

further all

Unit III

using dynamic

programming.

subset-sum

problem.

4 How will you find the shortest path between two given vertices using

Dijkstra's

algorithm? Explain.

UNIT IV

1.,What are the factors that influence the efficiency of the

backtracking algorithm?

The term Branch-and-Bound refers to all the state space methods in which

all

children of the E-node are generated before any other live node can

Branch-and-Bound

method.

method

are:

i. FIFO

ii. LIFO

iii. LC

The problem is to place eight queens on a 8 x 8 chessboard so that no two

queen

“attack” that is, so that no two of them are on the same row, column or

on the diagonal.

G can be colored in such a way that no two adjacent nodes have the same

A graph is said to be planar iff it can be drawn in such a way that no two

other.

The problems whose solutions have computing times are bounded by

polynomials of small

degree.

Any problem for which the answer is either zero or one is called decision

problem.

called

approximate solution.

- A Notes on Design & Analysis of AlgorithmTransféré parapi-19497515
- CS502_allTransféré parrung_baaz
- rootTransféré parPavan Kumar Reddy
- ln1ntroductionTransféré parAlper Cezibarak
- full notesTransféré parManu Ssvm
- daa 1mark questions and answersTransféré parkoteswararaopittala
- daaTransféré parRajesh Manoharan
- DAA TutorialsTransféré pardivyadarshan18
- Design and Analysis of AlgorithmsTransféré parAbdul Baasit
- Introduction to LispTransféré parlalitha
- TechnicalTransféré parSwadeesh
- adaNotes-1Transféré parpankajghorela
- Intro NotesTransféré parknshiva
- Algorithm Analysis and DesignTransféré parashok_bbsr
- Venkatesh Raman - Algo NotesTransféré parapi-26825468
- CLRS - Elements of Greedy StrategyTransféré parGeorge Chalhoub
- Problems on Algorithms (2002)Transféré parlcnblzr3877
- DAATransféré parSureshVitus
- CS2251-QBTransféré parKishore Arun Kumar
- David Mount - Algorithm Notes GoodTransféré parapi-26825468
- Dynamic programmingTransféré parVaranasi Srikar
- 07506220Transféré parRavi Tej
- selvaTransféré parSIVAMCHITRA255958
- Sol to hw15,16Transféré parDiponegoro Muhammad Khan
- d1dab016f3e9d489ee30b8f6926e5f35-OR-Tutorial_0Transféré pararun
- 9712374-Hotel-Management-Project-in-Java-Report.docTransféré parsiddi gyaneshwar
- ADA_ManualTransféré parMadhu Sudhan
- A Lgb Ronker BoshTransféré parEmanuella Gomes
- 0130232432AlgorithmicsTransféré parArn Jrn
- 2 MarksTransféré parsiswariya

- Primary Cutaneous Extragenital Canine Transmissible Venereal Tumour With Leishmania-laden Neoplastic Cells- A Further Suggestion of hTransféré parjen
- 2 Fluid Pressure Tutorial SolutionTransféré parScherraine Khrys Castillon
- IntroTo3DGraphcsWithDirect3DTransféré parhdquang
- Anchorage in OrthodonticsTransféré parKamal Shanto
- Lecturer (BPS-17) (Economics)Transféré parKamran Ali
- Sika Grout 214Transféré parSulaim Al Kautsar
- 1-s2.0-S240565611630102X-mainTransféré pardprdprdprdpr
- lecture 1 LCL flterTransféré parashikhmd4467
- The Marijuana Gateway FallacyTransféré parDaily Freeman
- Why Does Trend Following WorkTransféré parapi-3701488
- Evaluation of Academic Finance Conferences 2018 Journal of Banking FinanceTransféré parMunadi Idris
- discussion topic 3Transféré parapi-333208934
- 20181120 the Geopolitical Strategy of the US' Global Hegemony by a Notorious Russophobe Zbigniew Brzezinski _ OrientalReview.orgTransféré parddj.tech268
- ResumeTransféré parpowens3
- RX PresentationTransféré parwrite2arshad_m
- IEC Risk Assessment CalculatorTransféré parFredy J GC
- Asian Primate Diversity - D Brandon-Jones et al.pdfTransféré parjunet
- Supply Chain Management for Big Bazaar_CIA1Component1_Group9Transféré parAnindya Biswas
- Albine Care Au Supravietuit VarroaTransféré parCatalin
- PEHJ0082-04Transféré parPoop
- 4. Health- Similarities and Differences among people.docxTransféré parjoemari solmeron
- Universidad Catolica de Temuco FacultadTransféré parFranco Cruz
- Euronoise_bim and AcousticTransféré parCarlos Alejandro Nome
- $mp-043-06Transféré parkirancalls
- Case Study HuaweiTransféré parsaheerns
- Designing Measurable Objectives - Stakeholders - Graham KennyTransféré paraskdgas
- Joomsef ManualTransféré parGianluca Grasso
- Study-of-8086.pdfTransféré parDaryl Scott
- Paper Chromatography HandoutTransféré parIshaan Kumar
- SAECGTransféré parSaad Al Hely