gbxPEB
A Pen by Nir Bartov on CodePen.
A Pen by Nir Bartov on CodePen.
Algorithms Mid - Training! | |
Solution by Dr. Atif Alvi | |
Dated: August, 31 2015 (Fall 2015) | |
Course: Design and Analysis of Algorithms | |
Course Code : Comp 303 | |
_________________________________________ | |
#Standard Deviation |
Question - 1 Ǝ ∀ ˄˅ | |
a) A(Lois,Prof Michael) | |
b) ∀x S(x)-->A(x,Prof Gross) | |
c) | |
d) Some student has not asked any faculty member a question | |
Ǝx (S(x)˄∀y(F(y)-->~A(x,y) ) ) |
Discrete Math - solutions - Exercise 5.4 | |
Page no 370 | |
Q7. Give a recursive definition and algorithm for computing nx whenever n is a positive integer and x is an integer, using just addition. | |
P(0): x(0) = 0 | |
Nx = x+(n-1)x | |
Procedure mult (n: positive integer, x: integer) | |
if n=1 then mult(n,x):=x | |
else mult(n,x):=x+mult(n-1,x) |
#include<iostream> | |
#include <list> | |
using namespace std; | |
// Graph class represents a directed graph using adjacency list representation | |
class Graph | |
{ | |
int V; // No. of vertices | |
list<int> *adj; // Pointer to an array containing adjacency lists |