A Pen by Nir Bartov on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |