Data Structure Algorithms Using C A Practical Implementation 1st edition by Sachi Nandan Mohanty, Pabitra Kumar Tripathy 9781119752035 1119752035 - The ebook in PDF format is ready for download
Data Structure Algorithms Using C A Practical Implementation 1st edition by Sachi Nandan Mohanty, Pabitra Kumar Tripathy 9781119752035 1119752035 - The ebook in PDF format is ready for download
https://ebookball.com/product/problem-solving-in-data-structures-and-
algorithms-using-c-1st-edition-by-hemant-jain-
isbn-9352655915-9789352655915-15768/
https://ebookball.com/product/problem-solving-in-data-structures-and-
algorithms-using-c-1st-edition-by-hemant-jain-
isbn-1540407306-9781540407306-15866/
https://ebookball.com/product/data-structures-and-algorithms-in-c-1st-
edition-by-adam-drozdek-asin-b002wlxmby-25076/
https://ebookball.com/product/principles-of-data-structures-using-c-
and-c-1st-edition-by-vinu-das-isbn-8122418589-9788122418583-15766/
Data Structure and Algorithms
Using C++
Scrivener Publishing
100 Cummings Center, Suite 541J
Beverly, MA 01915-6106
Publishers at Scrivener
Martin Scrivener ([email protected])
Phillip Carmical ([email protected])
Data Structure
and Algorithms Using C++
A Practical Implementation
Edited by
Sachi Nandan Mohanty
ICFAI Foundation For Higher Education, Hyderabad, India
and
Pabitra Kumar Tripathy
Kalam Institute of Technology, Berhampur, India
This edition first published 2021 by John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, USA
and Scrivener Publishing LLC, 100 Cummings Center, Suite 541J, Beverly, MA 01915, USA
© 2021 Scrivener Publishing LLC
For more information about Scrivener publications please visit www.scrivenerpublishing.com.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or
transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or other-
wise, except as permitted by law. Advice on how to obtain permission to reuse material from this title
is available at http://www.wiley.com/go/permissions.
For details of our global editorial offices, customer services, and more information about Wiley prod-
ucts visit us at www.wiley.com.
ISBN 978-1-119-75054-3
Set in size of 11pt and Minion Pro by Manila Typesetting Company, Makati, Philippines
10 9 8 7 6 5 4 3 2 1
Contents
Preface xi
1 Introduction to Data Structure 1
1.1 Definition and Use of Data Structure 1
1.2 Types of Data Structure 2
1.3 Algorithm 3
1.4 Complexity of an Algorithm 6
1.5 Efficiency of an Algorithm 7
1.6 Asymptotic Notations 8
1.7 How to Determine Complexities 9
1.8 Questions 13
2 Review of Concepts of ‘C++’ 15
2.1 Array 15
2.1.1 One-Dimensional Array 16
2.1.2 Multi-Dimensional Array 17
2.1.3 String Handling 20
2.2 Function 26
2.2.1 User Defined Functions 26
2.2.2 Construction of a Function 27
2.2.3 Actual Argument and Formal Argument 31
2.2.4 Call by Value and Call by Reference 32
2.2.5 Default Values for Parameters 34
2.2.6 Storage Class Specifiers 35
2.3 Pointer 37
2.3.1 Declaration of a Pointer 37
2.3.2 Initialization of a Pointer 37
2.3.3 Arithmetic With Pointer 38
2.3.4 Passing of a Pointer to Function 39
2.3.5 Returning of a Pointer by Function 40
2.3.6 C++ Null Pointer 41
v
vi Contents
2.4 Structure 42
2.4.1 The typedef Keyword 46
2.5 Questions 47
3 Sparse Matrix 49
3.1 What is Sparse Matrix 49
3.2 Sparse Matrix Representations 49
3.3 Algorithm to Represent the Sparse Matrix 51
3.4 Programs Related to Sparse Matrix 52
3.5 Why to Use Sparse Matrix Instead of Simple Matrix? 56
3.6 Drawbacks of Sparse Matrix 57
3.7 Sparse Matrix and Machine Learning 57
3.8 Questions 58
4 Concepts of Class 59
4.1 Introduction to CLASS 59
4.2 Access Specifiers in C++ 60
4.3 Declaration of Class 60
4.4 Some Manipulator Used In C++ 62
4.5 Defining the Member Functions Outside of the Class 64
4.6 Array of Objects 64
4.7 Pointer to Object 66
4.8 Inline Member Function 67
4.9 Friend Function 69
4.9.1 Simple Friend Function 69
4.9.2 Friend With Inline Substitution 70
4.9.3 Granting Friendship to Another Class
(Friend Class) 71
4.9.4 More Than One Class Having the Same
Friend Function 73
4.10 Static Data Member and Member Functions 75
4.11 Constructor and Destructor 78
4.11.1 Constructor 78
4.11.1.1 Empty Constructor 79
4.11.1.2 Default Constructor 79
4.11.1.3 Parameterized Constructors 80
4.11.1.4 Copy Constructor 81
4.11.2 Destructor 83
4.12 Dynamic Memory Allocation 84
4.13 This Pointer 86
4.14 Class Within Class 87
4.15 Questions 89
Contents vii
5 Stack 91
5.1 STACK 91
5.2 Operations Performed With STACK 91
5.3 ALGORITHMS 93
5.4 Applications of STACK 96
5.5 Programming Implementations of STACK 106
5.6 Questions 126
6 Queue 129
6.1 Queue 129
6.2 Types of Queue 129
6.3 Linear Queue 129
6.4 Circular Queue 134
6.5 Double Ended Queue 138
6.6 Priority Queue 139
6.7 Programs 142
6.8 Questions 165
7 Linked List 167
7.1 Why Use Linked List? 167
7.2 Types of Link List 167
7.3 Single Link List 168
7.4 Programs Related to Single Linked List 177
7.4.1 /* Creation of a Linked List */ 177
7.4.2 /* Insert a Node Into a Simple Linked List at
the Beginning */ 178
7.4.3 /* Insert a Node Into a Simple Linked List at
the End of the List */ 180
7.4.4 /* Insert a Node Into a Simple Linked List
When the Node Is Known */ 182
7.4.5 /* Insert a Node Into a Simple Linked List
Information Is Known and Put After Some
Specified Node */ 184
7.4.6 /* Deleting the First Node From a Simple
Linked List */ 187
7.4.7 /* Deleting the Last Node From a Simple
Linked List */ 189
7.4.8 /* Deleting a Node From a Simple Linked
List When Node Number Is Known */ 191
7.4.9 Deleting a Node From a Simple Linked List
When Information of a Node Is Given 193
viii Contents
11 Hashing 391
11.1 Hash Functions 391
11.2 Collisions 393
11.3 Collision Resolution Methods 393
11.4 Clustering 394
11.5 Questions 395
Index 397
Preface
Welcome to the first edition of Data Structures and Algorithms Using C++.
A data structure is the logical or mathematical arrangement of data in
memory. To be effective, data has to be organized in a manner that adds to
the efficiency of an algorithm and also describe the relationships between
these data items and the operations that can be performed on these items.
The choice of appropriate data structures and algorithms forms the funda-
mental step in the design of an efficient program. Thus, a deep understand-
ing of data structure concepts is essential for students who wish to work
on the design and implementation of system software written in C++, an
object-oriented programming language that has gained popularity in both
academia and industry. Therefore, this book was developed to provide
comprehensive and logical coverage of data structures like stacks, queues,
linked lists, trees and graphs, which makes it an excellent choice for learn-
ing data structures. The objective of the book is to introduce the concepts
of data structures and apply these concepts in real-life problem solving.
Most of the examples presented resulted from student interaction in the
classroom. This book utilizes a systematic approach wherein the design of
each of the data structures is followed by algorithms of different operations
that can be performed on them and the analysis of these algorithms in
terms of their running times.
This book was designed to serve as a textbook for undergraduate engi-
neering students across all disciplines and postgraduate level courses in
computer applications. Young researchers working on efficient data storage
and related applications will also find it to be a helpful reference source to
guide them in the newly established techniques of this rapidly growing
research field.
xi
1
Introduction to Data Structure
• Organization of data
• Accessing methods
• Degree of associativity
• Processing alternatives for information
The data structures are the building blocks of a program and hence the
selection of a particular data structure stresses on
Sachi Nandan Mohanty and Pabitra Kumar Tripathy. Data Structure and Algorithms Using C++:
A Practical Implementation, (1–14) © 2021 Scrivener Publishing LLC
1
2 Data Structure and Algorithms Using C++
DATA STRUCTURE
• Traversing
• Insertion
• Deletion
• Merging
• Sorting
• Searching
Introduction to Data Structure 3
1.3 Algorithm
The step by step procedure to solve a problem is known as the ALGORITHM.
An algorithm is a well-organized, pre-arranged, and defined computational
module that receives some values or set of values as input and provides a
single or set of values as out put. These well-defined computational steps
are arranged in sequence, which processes the given input into output.
An algorithm is said to be accurate and truthful only when it provides
the exact wanted output.
The efficiency of an algorithm depends on the time and space complex-
ities. The complexity of an algorithm is the function which gives the run-
ning time and/or space in terms of the input size.
Ex :
5.23 = 5 5.23 =6
4 Data Structure and Algorithms Using C++
Remainder Function
To find the remainder “mod” function is being used as
A mod B
Summation Symbol
To add a series of number as a1+ a2 + a3 +…………+ an the
symbol Σ is used
n
Σ ai
i=1
Factorial of a Number
The product of the positive integers from 1 to n is known as
the factorial of n and it is denoted as n!.
0! = 1
Algorithemic Notations
While writing the algorithm the comments are provided with in [ ].
The assignment should use the symbol “: =” instead of “=”
For Input use Read : variable name
For output use write : message/variable name
The control structures can also be allowed to use inside an algorithm but
their way of approaching will be some what different as
Simple If
If condition, then:
Statements
[end of if structure]
Introduction to Data Structure 5
If…else
If condition, then:
Statements
Else :
Statements
[end of if structure]
If…else ladder
If condition1, then:
Statements
Else If condition2, then:
Statements
Else If condition3, then:
Statements
…………………………………………
…………………………………………
…………………………………………
Else If conditionN, then:
Statements
Else:
Statements
[end of if structure]
LOOPING CONSTRUCT
Repeat for var = start_value to end_value by
step_value
Statements
[end of loop]
OUTPUT
1 3 5 7 9
6 Data Structure and Algorithms Using C++
Space Complexity
The space complexity of a program is the amount of memory it needs to
run to completion. The space needed by a program is the sum of the fol-
lowing components:
• A fixed part that includes space for the code, space for sim-
ple variables and fixed size component variables, space for
constants, etc.
• A variable part that consists of the space needed by com-
ponent variables whose size is dependent on the particular
problem instance being solved, and the stack space used by
recursive procedures.
Time Complexity
The time complexity of a program is the amount of computer time it needs
to run to completion. The time complexity is of two types such as
• Compilation time
• Runtime
Suppose space is fixed for one algorithm then only run time will be con-
sidered for obtaining the complexity of algorithm, these are
• Best case
• Worst case
• Average case
Best Case
Generally, most of the algorithms behave sometimes in best case. In this
case, algorithm searches the element for the first time by itself.
For example: In linear search, if it finds the element for the first time by
itself, then it behaves as the best case. Best case takes shortest time to exe-
cute, as it causes the algorithms to do the least amount of work.
Worst Case
In worst case, we find the element at the end or when searching of elements
fails. This could involve comparing the key to each list value for a total of
N comparisons.
For example in linear search suppose the element for which algorithm
is searching is the last element of array or it is not available in array then
algorithm behaves as worst case.
Average Case
Analyzing the average case behavior algorithm is a little bit complex than
the best case and worst case. Here, we take the probability with a list of
data. Average case of algorithm should be the average number of steps but
since data can be at any place, so finding exact behavior of algorithm is
difficult. As the volume of data increases, the average case of algorithm
behaves like the worst case of algorithm.
Introduction
An important question is: How efficient is an algorithm or piece of code?
Efficiency covers lots of resources, including:
CPU (time) usage
Memory usage
Disk usage
Network usage
Introduction to Data Structure 9
All are important but we will mostly talk about CPU time
Be careful to differentiate between:
Note: As an example,
O(1) refers to constant time.
O(n) indicates linear time;
O(nk) (k fixed) refers to polynomial time;
O(log n) is called logarithmic time;
O(2n) refers to exponential time, etc.
n² + 3n + 4 is O(n²), since n² + 3n + 4 < 2n² for all n > 10. Strictly speaking,
3n + 4 is O(n²), too, but big-O notation is often misused to mean equal to
rather than less than.
1. Sequence of statements
statement 1;
statement 2;
...
statement k;
10 Data Structure and Algorithms Using C++
The outer loop executes N times. Every time the outer loop
executes, the inner loop executes M times. As a result, the
statements in the inner loop execute a total of N * M times.
Thus, the complexity is O(N * M). In a common special case
Introduction to Data Structure 11
Examples
Q1. What is the worst-case complexity of the each of the following code
fragments?
Answer: Th
e first loop is O(N) and the second loop is O(M). Since you
do not know which is bigger, you say this is O(N+M). This can
also be written as O(max(N,M)). In the case where the second
loop goes to N instead of M the complexity is O(N). You can
see this from either expression above. O(N+M) becomes O(2N)
and when you drop the constant it is O(N). O(max(N,M))
becomes O(max(N,N)) which is O(N).
12 Data Structure and Algorithms Using C++
Q2. How would the complexity change if the second loop went to N
instead of M?
A nested loop followed by a non-nested loop:
for (i = 0; i < N; i++) {
for (j = 0; j < N; j++) {
sequence of statements
}
}
for (k = 0; k < N; k++) {
sequence of statements
}
Answer: Th
e first set of nested loops is O(N2) and the second loop is
O(N). This is O(max(N2,N)) which is O(N2).
Q3. A nested loop in which the number of times the inner loop executes
depends on the value of the outer loop index:
for (i = 0; i < N; i++) {
for (j = i; j < N; j++) {
sequence of statements
}
}
Answer: W
hen i is 0 the inner loop executes N times. When i is 1 the
inner loop executes N-1 times. In the last iteration of the outer
loop when i is N-1 the inner loop executes 1 time. The number
of times the inner loop statements execute is N + N-1 + ... + 2 +
1. This sum is N(N+1)/2 and gives O(N2).
Q4. For each of the following loops with a method call, determine the
overall complexity. As above, assume that method f takes constant time,
and that method g takes time linear in the value of its parameter.
Answer: a. E
ach call to f(j) is O(1). The loop executes N times so it is N x
O(1) or O(N).
b. The first time the loop executes j is 0 and g(0) takes “no oper-
ations.” The next time j is 1 and g(1) takes 1 operations. The
last time the loop executes j is N-1 and g(N-1) takes N-1 oper-
ations. The total work is the sum of the first N-1 numbers and
is O(N2).
Introduction to Data Structure 13
c. Each time through the loop g(k) takes k operations and the
loop executes N times. Since you do not know the relative size
of k and N, the overall complexity is O(N x k).
1.8 Questions
1. What is data structure?
2. What are the types of operations that can be performed with
data structure?
3. What is asymptotic notation and why is this used?
4. What is complexity and its type?
5. Find the complexity of 3n2 + 5n.
6. Distinguish between linear and non-linear data structure.
7. Is it necessary is use data structure in every field? Justify
your answer.
2
Review of Concepts of ‘C++’
2.1 Array
Whenever we want to store some values then we have to take the help of a
variable, and for this we must have to declare it before its use. If we want
to store the details of a student so for this purpose we have to declare the
variables as
char name [20], add[30] ;
int roll, age, regdno ;
float total, avg ;
etc……
for a individual student.
If we want to store the details of more than one student than we have to
declare a huge amount of variables and which are too much difficult to access
it. I.e/ the programs length will increased too faster. So it will be better to
declare the variables in a group. I.e/ name variable will be used for more than
one student, roll variable will be used for more than one student, etc.
So to declare the variable of same kind in a group is known as the Array
and the concept of array is used for this purpose only.
Types of Array:
The arrays can be further classified into two broad categories such as:
Sachi Nandan Mohanty and Pabitra Kumar Tripathy. Data Structure and Algorithms Using C++:
A Practical Implementation, (15–48) © 2021 Scrivener Publishing LLC
15
16 Data Structure and Algorithms Using C++
Syntax :
Data type variable_name[bound] ;
The data type may be one of the data types that we are studied. The
variable name is also same as the normal variable_name but the bound is
the number which will further specify that how much variables you want
to combine into a single unit.
Ex : int roll[15];
In the above example roll is an array 15 variables whose capacity is to
store the roll_number of 15 students.
And the individual variables are
roll[0] , roll[1], roll[2], roll[3] ,……………..,roll[14]
Initialization:
The array is also initialized just like other normal variable except that
we have to pass a group of elements with in a chain bracket separated by
commas.
Ex : int x[5]= { 24,23,5,67,897 } ;
In the above statement x[0] = 24, x[1] = 23, x[2]=5, x[3]=67,x[4]=897
Review of Concepts of ‘C++’ 17
#include<iostream.h>
void main()
{
int x[10],i;
;
cout<<“\nEnter 10 elements into the array”;
for(i=0 ; i<10; i++)
cin>>x[i];
cout<<“\n THE ENTERED ARRAY ELEMENTS ARE :”;
for(i=0 ; i<10; i++)
cout<<” “<<x[i];
}
OUTPUT
Enter 10 elements into the array
12
36
89
54
6
125
35
87
49
6
THE ENTERED ARRAY ELEMENTS ARE : 12 36
89 54 6 125 35 87 49 6
But we do use the two dimensional array to handle the matrix opera-
tions. The two dimensional array having two boundary specifications.
SYNTAX
data_type variable_name[boundary1][boundary2];
Ex : int x[3][4];
In the above example x is the two dimensional array which has the capacity
to store (3x4) 12 elements. The individual number of elements are
x[0][0] x[0][1] x[0][2] x[0][3]
x[1][0] x[1][1] x[1][2] x[1][3]
x[2][0] x[2][1] x[2][2] x[2][3]
INITIALIZATION
The array can also be initialized as like one dimensional array.
Ex: int x[3][4] = {{3,5,7,8}, {45,12,34,3}, {56,89,56,23}};
OR
int x[3][4] = {3,5,7,8,45,12,34,3,56,89,56,23};
After the above initialization
x[0][0]=3 x[0][1]=5 x[0][2]=7 x[0][3]=8
x[1][0]=45 x[1][1]=12 x[1][2]=34 x[1][3]=3
x[2][0]=56 x[2][1]=89 x[2][2]=56 x[2][3]=23
#include<iostream.h>
void main()
{
int mat[3][3],i,j,sum=0;
OUTPUT
Enter a number 5
Enter a number 7
Enter a number 9
Enter a number 2
Enter a number 6
Enter a number 8
Enter a number 12
Enter a number 24
Enter a number 7
I n d i a \0
0 1 2 3 4 5 6 7 8 9
Review of Concepts of ‘C++’ 21
I n d i a
0 1 2 3 4 5 6 7 8 9
I n d i a \0
0 1 2 3 4 5 6 7 8 9
OUTPUT
Enter a string Hello
THE ENTERED STRING IS Hello
OR
22 Data Structure and Algorithms Using C++
OR
#include<iostream.h>
void main()
{
char x[20];
int i;
cout<<"\nEnter a string";
gets(x);
cout<<"\n THE ENTERED STRING IS ";
for(i=0; x[i]!=’\0’;i++)
cout<<x[i];
}
OUTPUT
Enter a string Hello
THE ENTERED STRING IS Hello
Example – 2
Write a program to input a string and count how many vowels are in it.
#include<iostream.h>
void main()
{
char x[20];
int i,count=0;
cout<<"\n Enter a string";
gets(x);
cout<<"\n The entered string is"<<x;
for(i=0; x[i]!='\0';i++)
if(toupper(x[i])=='A' || toupper(x[i])=='E'
|| toupper(x[i])=='I' || toupper (x[i])=='O' ||
toupper(x[i))=='U')
count++;
cout<<"\n The string"<<x<< "having"<<count<<"num-
bers of vowels";
}
OUTPUT
Enter a string Wel Come
The entered string is Wel Come
The string Wel Come having 3 numbers of vowels.
Example :
Write a program to find out the length of a string.
#include<iostream.h>
void main()
{
char x[20];
int i,len=0;
cout<<"\n Enter a string";
gets(x);
for(i=0;x[i]!='\0';i++)
len++;
cout<<"\n THE LENGTH OF"<<x<<"IS"<<len;
}
24 Data Structure and Algorithms Using C++
OUTPUT
Enter a string hello India
THE LENGTH OF hello India IS 11
OR
#include<iostream.h>
void main()
{
char x[20];
int i;
cout<<"\n Enter a string";
gets(x);
for(i=0;x[i]!='\0';i++) ;
cout<<"\n THE LENGTH OF"<<x<<"IS"<<len;
}
OUTPUT
Enter a string hello India
THE LENGTH OF hello India IS 11
String Manipulation
The strings cannot be manipulated with the normal operators, so to have
some manipulation we have to use the help of certain string handling
functions. ’C’-language provides a number of string handling functions
amongst them the most popularly used functions are
a. Strlen()
b. Strrev()
c. Strcat()
d. Strcmp()
e. Strcpy()
f. Strupr()
g. Strlwr()
These functions prototypes are declared inside the header file string.h
Strlen()
Purpose : Used to find out the length of a string.
Syntax : integer_variable = strlen(string);
Review of Concepts of ‘C++’ 25
Strrev()
Purpose : Used to find out the reverse of a string.
Syntax : strrev(string);
Strcat()
Purpose: Used to concatenate(Join) two strings. It will
append the source string at the end of the destination. The
length of the destination will be the length of source + length
of destination
Syntax: strcat(destination,source);
Strcmp()
Purpose: Used to compare two strings.
Process: The string comparison always starts with the first
character in each string and continuous with subsequent
characters until the corresponding characters differ or until
the end of a string is reached.
The string comparison is always based upon the ASCII values of the
characters.
Syntax : integer_variable = strcmp(s1,s2);
Strcpy()
Purpose :To copy a string to other.
Syntax : strcpy(destination,source);
Strupr()
Purpose : To convert all the lower case alphabets to its cor-
responding upper-case.
Syntax : strupr(string);
Strlwr()
Purpose : To convert all the upper case alphabets to its cor-
responding lower-case.
Syntax : strlwr(string);
26 Data Structure and Algorithms Using C++
2.2 Function
Definition: One or more than one statements combined together to form
a block with a particular name and having a specific task.
The functions in ‘C’ are classified into two types as
The library functions are already comes with the ‘C’ compiler(Language).
Ex : printf(), scanf(), gets(), clrscr(), strlen() etc.
The user defined functions are defined by the programmer when ever
required.
Parts of a Function
A function has generally three parts as
Ex:
int sum(int p, int q)
{
int z;
z = p+q;
return(z);
}
Return_type function_name(void);
Ex : int sum();
CALL
Variable = function_name();
Ex : x = sum();
Where x is an integer.
DEFINITION
Return_type function_name()
{
Body of function;
Return(value/variable/expression);
}
Ex:
int sum()
{
int a,b;
cout<<"\nEnter 2 numbers";
cin>>a>>b;
return(a+b);
}
Ex : void sum(int,int);
CALL
function_name(var1,var2,var3…………);
Ex : sum(x,y);
Where x and y is an integer.
DEFINITION
Void function_name (data_type1 v1, data_type2 v2,………)
{
Body of function ;
}
Ex:
void sum(int x, int y)
{
cout<<"\nSum = "<<x+y;
}
Review of Concepts of ‘C++’ 29
Ex : sum();
DEFINITION
Void function_name ()
{
Body of function ;
}
Ex:
void sum()
{
int x,y;
cout<<"\n Enter two numbers";
cin>>x>>y;
cout<<"\nSum = "<<x+y;
}
OUTPUT
Enter two numbers 5
6
Addition of 5 and 6 is 11
Category – 2
#include<iostream.h>
void main()
{
int sum();
int z;
z = sum();
cout<<"\n Addition is"<<z;
}
int sum()
{
int x,y;
cout<<"\n Enter two numbers";
cin>>x>>y;
return(x+y);
}
OUTPUT
Enter two numbers 5
6
Addition is 11
Category – 3
#include<iostream.h>
void main()
{
void sum(int,int);
int x,y;
cout<<"\n Enter two numbers";
cin>>x>>y;
sum(x,y);
}
void sum(int p,int q)
{
Cout<<“\n Addition
of”<<p<<”and”<<q<<”is”<<p+q;
}
OUTPUT
Enter two numbers 5
6
Addition of 5 and 6 is 11
Review of Concepts of ‘C++’ 31
Category – 4
#include<iostream.h>
void main()
{
void sum();
sum();
}
void sum()
{
int x,y;
cout<<"\n Enter two numbers";
cin>>x>>y;
cout<<"Addition of"<<x<<"and"<<y<<"is"<<x+y;
}
OUTPUT
Enter two numbers 5
6
Addition of 5 and 6 is 11
Ex:
#include<iostream.h>
void main()
{
int sum(int,int);
int x,y,z;
cout<<"\n Enter two numbers";
cin>>x>>y;
z = sum(x,y); /* Here x and y are called as the
actual argument*/
cout<<"\n Addition of"<<x<<"and"<<y<<"is"<<z;
}
int sum(int p, int q) /* Here p and q are called as the formal
argument */
{
int r;
r = p+q;
return(r);
}
32 Data Structure and Algorithms Using C++
OUTPUT
Enter two numbers 5
6
Addition of 5 and 6 is 11
Ex:
Call by value
#include<iostream.h>
void main()
{
int x=5,y=6;
void change(int,int);
cout<<“\n X=”<<x<<”and Y=”<<y;
change(x,y);
cout<<“\n X=”<<x<<”and Y=”<<y;
}
void change(int a,int b)
{
a=a+5;
b=b+5;
cout<<“\n X=”<<a<<”and Y=”<<b;
}
OUTPUT
X = 5 and Y=6
X=10 and Y=11
X=5 and Y=6
Call by REFERENCE
#include<iostream.h>
void main()
{
int x=5,y=6;
void change(int *,int *);
34 Data Structure and Algorithms Using C++
OUTPUT
X = 5 and Y=6
X=10 and Y=11
X=10 and Y=11
result = a + b;
return (result);
}
int main ()
{
// local variable declaration:
int a = 100;
int b = 200;
int result;
Review of Concepts of ‘C++’ 35
return 0;
}
When the above code is compiled and executed, it produces following
result:
Total value is :300
Total value is :120
REGISTER
Initial Value : Garbage
Storage Area : CPU Memory
Life : With in the block where it is declared
Scope : Local
Difference between STATIC and AUTO
#include<stdio.h>
void main()
{
void change();
change();
change();
change();
}
Void change()
{
auto int x=0;
printf(“\n X= %d”,x);
x++;
}
OUTPUT
X=0
X=0
X=0
#include<stdio.h>
void main()
{
void change();
change();
change();
change();
}
Void change()
{
static int x;
printf("\n X= %d",x);
x++;
}
OUTPUT
X=0
X=1
X=2
Review of Concepts of ‘C++’ 37
2.3 Pointer
The pointer is a variable which can store the address of another variable.
Whatever changed with the value of the variable with the help of the
pointer that will directly effect to it.
Example :(IN C)
WRITE A PROGRAM TO INPUT A NUMBER AND DISPLAY IT.
#include<iostream.h>
void main() INSIDE MEMORY
{ P X
int *p,x; P=&X
1087 5
p=&x;
printf(“\n Enter a number”);
scanf(“%d”,&x);
732 1087 P = 1087, *P=5
X=5 AND &X = 1087
OUTPUT
Enter a number 5
NOTE : Pointer means the address so we can perform any type of opera-
tion with *p (value at address)
DECLARATION
Return_type function_name(data_type *, data_type *,…………);
CALL
Variable = function_name(ptrvar, ptrvar, ptrvar,………);
DEFINITION
Return_type function_name(data_type *var, data_type *var,…………)
{
body of function ;
return(value/var/exp);
}
Example:
WRITE A PROGRAM TO FINDOUT THE FACTORIAL OF A NUMBER
#include<iostream.h>
void main()
{
long int fact(int *);
int *n;
long int f;
cout<<“\n Enter a number”;
cin>>*n;
f=fact(n);
cout<<“\n Factorial Is”<<f;
}
long int fact(int *p)
{
int i;
long int f=1;
for(i=1;i<=*p;i++)
f*=i;
return(f);
}
Other documents randomly have
different content
[122] Cunningham, vol. i. p. 26.
[123] Ibid. p. 757.
[124] Ibid.
[125] Walpole’s Anecdotes, vol. i. p. 282.
[126] Galt’s Life of West, pt. ii. p. 25.
[127] Ibid. pp. 36-38.
[128] Strange’s Enquiry into the Rise and Establishment of the Royal
Academy (1775).
[129] Pye’s Patronage of British Art, p. 134.
[130] The original thirty-six Academicians were—Benjamin West,
Francesco Zuccarelli, Nathaniel Dance, Richard Wilson, George
Michael Moser, Samuel Wale (a sign-painter), J. Baptist Cipriani,
Jeremiah Meyer, Angelica Kauffmann, Charles Catton (a coach and
sign painter), Francesco Bartolozzi, Francis Cotes, Edward Penny,
George Barrett (Wilson’s rival), Paul Sandby, Richard Yeo, Mary
Moser, Agostino Carlini, William Chambers (the architect of Somerset
House), Joseph Wilton (the sculptor), Francis Milner Newton, Francis
Hayman, John Baker, Mason Chamberlin, John Gwynn, Thomas
Gainsborough, Dominick Serres, Peter Toms (a drapery painter for
Reynolds, who finally committed suicide), Nathaniel Hone (who for
his libel on Reynolds was expelled the Academy), Joshua Reynolds,
John Richards, Thomas Sandby, George Dance, J. Tyler, William
Hoare of Bath, and Johann Zoffani. In 1772 Edward Burch, Richard
Cosway, Joseph Nollekens, and James Barry (expelled in 1797),
made up the forty.—Wornum’s Preface to the Lectures on Painting.
[131] Pye’s Patronage of British Art, 1845, p. 136.
[132] Royal Academy Catalogues, Brit. Mus.
[133] Smith’s Nollekens, vol. i. p. 381.
[134] Life of Haydon, by Tom Taylor, vol. i. p. 30.
[135] Ibid. p. 20.
[136] Thornbury’s Life of Turner.
[137] O’Keefe’s Life vol. i. p. 386.
[138] Knowles’s Life of Fuseli, vol. i. p. 32.
[139] Irvine’s Life of Falconer.
[140] Smith’s Life of Nollekens, vol. ii. p. 129.
[141] Hatton, p. 785.
[142] Postman, No. 80.
[143] Life of Blake, by Gilchrist.
[144] Andrews’s History of Journalism, vol. ii. p. 85.
[145] Strype, B. iii. p. 196.
[146] Glover’s Life, p. 6.
[147] Dennis’s Letters, p. 196.
[148] Procter’s Life of Kean, vol. ii. p. 140.
[149] Dr. King’s Art of Cookery.
[150] Spectator, No. 9.
[151] Memoirs of the Kit-Cat Club, p. 6.
[152] Defoe’s Journal, vol. i. p. 287.
[153] Letters of Lady M. W. Montagu, edited by W. M. Thomas, Esq.
[154] Annual Obituary, vol. vii.
[155] Monthly Repository, by Leigh Hunt, 1836.
[156] Procter’s Life of Kean.
[157] The Temple Anecdotes (Groombridge), p. 50.
[158] Strype, B. iv. p. 120.
[159] Ibid.
[160] Dixon’s Bacon, p. 227.
[161] Appendix to the Tatler, vol. iv. p. 615.
[162] Smith’s Streets of London, vol. iv. p. 244.
[163] Egerton Papers, by Collier, p. 376.
[164] Strype, B. vi. p. 76.
[165] Cunningham, vol. i. p. 283.
[166] London Gazette, No. 897.
[167] Pepys, vol. i. p. 137, 4to ed.
[168] Horace Walpole.
[169] Otway.
[170] Spectator, No. 155.
[171] Tatler, No. 26.
[172] Nouvelle Biographie Univ., vol. xxxviii. p. 19.
[173] Ducatus Leodiensis, fol. 1715, p. 485.
[174] British Apollo (1740), ii. p. 376.
[175] Oldys’s Life of Raleigh, p. 145.
[176] Aubrey, vol. iii. p. 513.
[177] Gough’s British Topography, vol. i. p. 743.
[178] Walpole’s Mems. of George III., vol. iv. p. 173.
[179] Elmes’s Anecdotes, vol. iii.
[180] Cunningham, vol. i. p. 83.
[181] Boswell, vol. i. p. 225.
[182] Hone’s Everyday Book, vol. i. p. 237.
[183] Pye’s Patronage of British Art (1845), pp. 61, 62.
[184] Wine and Walnuts, vol. i. p. 161.
[185] Smith’s Nollekens, vol. i. p. 3.
[186] Ibid. vol. ii. p. 203.
[187] Haydon’s Life, vol. iii. p. 182.
[188] Book about Doctors, by J. C. Jeaffreson, p. 221.
[189] Archenholz, p. 109.
[190] Colman’s Random Records.
[191] See the Percy Society’s Publications.
[192] Rymer, iii. 926.
[193] Chaucer’s Works.
[194] Dugdale’s Baronetage, vol. 1. p. 789.
[195] Scala Chron., p. 175; Froissart, c. 161.
[196] Rymer, vi. 452.
[197] Froissart, lix.
[198] Walsingham, p. 248.
[199] Holinshed, vol. ii. p. 431.
[200] Shakspere incorrectly makes Jack Cade burn the Savoy. He
has attributed to that Irish impostor the act of Wat Tyler, a far more
patriotic man.
[201] Stow.
[202] Cowley’s Works, 10th edit. (Tonson), 1707, vol. ii. p. 587.
[203] Letter to Evelyn. Cowley’s Works (1707), vol. ii. p. 731.
[204] J. T. Smith’s Antiquarian Ramble in the Streets of London
(1846), vol. i. p. 255.
[205] Baker’s Chronicle (1730), p. 625.
[206] Cunningham’s London (1849), vol. ii. p. 728.
[207] The Postman (1696), No. 180.
[208] Strype, B. iv. p. 107, ed. 1720.
[209] Hughson’s Walks through London, p. 207.
[210] Hughson’s Walks through London, p. 209.
[211] Dryden’s Works (1821 ed.), vol. ii. p. 105.
[212] Athenæ Ox. vol. ii. p. 1036.
[213] Cunningham (1849), vol. ii. p. 537.
[214] Wood’s Athen. Ox. ii. 396, ed. 1721.
[215] The Shepherd’s Hunting (1633).
[216] Macaulay’s History of England, vol. ii. chap. v.
[217] Buckingham’s Works (1704), p. 15.
[218] All the Year Round, May 12, 1860 (The Precinct).
[219] Andrews’s History of British Journalism, vol. ii. p. 83.
[220] Smiles’s Lives of the Engineers, vol. ii. p. 187.
[221] Smiles’s Lives of the Engineers, vol. ii. p. 186.
[222] Ibid., vol. ii. p. 93.
[223] Hepworth Dixon’s Story of Lord Bacon’s Life (1862), p. 14.
[224] Montagu, xii. 420, 432.
[225] Aubrey’s Lives, vol. ii. p. 224; Dixon’s Bacon, p. 315.
[226] Character of Lord Bacon.
[227] Dixon’s Story of Lord Bacon’s Life, p. 33 (1862). Pearce’s Inns
of Court.
[228] Sir B. Gerbier.
[229] Bassompierre’s Embassy to England.
[230] Whitelocke, p. 167.
[231] Peacham’s Compleat Gentleman, ed. 1661, p. 108.
[232] Pepys, 6th June 1663.
[233] Dryden (Scott), vol. ix. p. 233.
[234] Pepys’s Diary. vol. i. p. 223.
[235] Evelyn’s Memoirs, vol. i. p. 530.
[236] Rate Books of St. Martin’s.
[237] Cole’s MSS., vol. xx. folio 220.
[238] Gilchrist’s Life of Etty, vol. i. p. 221.
[239] Barrow’s Life of Peter the Great, p. 90.
[240] Ballard’s Collection, Bodleian.
[241] Pennant.
[242] Strype, B. vi. p. 76.
[243] Cunningham, vol. i. pp. 402, 403.
[244] Rate-books of St. Martin’s.
[245] Memorials of Franklin, vol. i. p. 261.
[246] Smith’s Comic Misc. vol. ii. p. 186.
[247] Memoirs of James Smith, by Horace Smith, vol. i. p. 32.
[248] Memoirs of James Smith, by Horace Smith, vol. i. p. 54.
[249] Smith’s Nollekens, vol. i. p. 340.
[250] Ibid. vol. i. pt 302.
[251] Harl. MSS. 6850.
[252] Rate-books of St. Martin’s.
[253] Smith’s Book for a Rainy Day, pp. 281, 282.
[254] Cal. Rot. Patentium.
[255] Brayley’s Beauties of England and Wales, vol. x. part iv. p. 167.
[256] Father Hubbard’s Tale, 4to, 1604.—Middleton’s Works, vol. v.
p. 573.
[257] Archer’s Vestiges of Old London (View of Crockford’s shop).
[258] Walpole’s Anecdotes, vol. iii. p. 911.
[259] Malcolm’s Londinum Rediviv. vol. iii. p. 397.
[260] Hughson’s Walks (1829).
[261] Boswell’s Life of Johnson, vol. i. p. 383.
[262] Boswell, vol. iii. p. 331.
[263] Censura Literaria, vol. i. p. 176.
[264] Spence’s Anecdotes.
[265] State Poems, vol. ii. p. 143 (“A Satyr on the Poets.”)
[266] Leigh Hunt’s Town (1857), p. 135.
[267] Hughson’s Walks, p. 184.
[268] Leigh Hunt’s Town (1859 ed.), p. 134.
[269] Strype, B. iv. p. 117.
[270] Boswell.
[271] Walpole’s Anecdotes (ed. Dallaway), vol. ii. p. 315.
[272] Leigh Hunt’s Town (1859), p. 145.
[273] Brayley’s Beauties of England and Wales, vol. x. part iv. p. 166.
[274] Malone’s Shakspere, vol. iii. p. 516.
[275] Nichols’s Hogarth, vol. ii. p. 70.
[276] Cunningham (1849), vol. i. p. 210.
[277] Hughson’s Walks through London, p. 188.
[278] Chalmers’s Biog. Dict. vol. v. p. 64.
[279] Boswell, ed. Croker, vol. ii. 201.
[280] Stow, p. 166.
[281] Sir G. Buc, in Howes (ed. 1631), p. 1075.
[282] Fitzstephen, circa, 1178: the quotation refers, however, more
to the north of London.
[283] Tennyson.
[284] Malcolm’s London, vol. ii.
[285] Knox’s Elegant Extracts.
[286] Leigh Hunt’s Town, p. 146.
[287] Henry IV. second part, act iii. sc. 2.
[288] Prot. Dissenters’ Magazine, vol. vi.
[289] Smith’s Life of Nollekens, vol. i. 365.
[290] Cradock’s Memoirs, vol. iv. p. 166.
[291] Garrard to the Earl of Strafford, vol. i. p. 227.
[292] Citie’s Loyaltie Displayed, 4to, 1661.
[293] Pepys.
[294] Aubrey’s Anecdotes, vol. iii. p. 457.
[295] Malcolm’s Streets of London (1846), vol. i. p. 363.
[296] Parish Clerks’ Survey, p. 286.
[297] Cunningham’s Lives of the Painters, vol. iii. p. 292.
[298] Pope’s Dunciad.
[299] Addison’s Freeholder, No. 4.
[300] J. T. Smith’s Streets of London (1846), vol. i. pp. 366, 367.
[301] Sir G. Buc (Stow by Howes), p. 1075, ed. 1631.
[302] Roper’s Life of Sir Thomas More, by Singer, p. 52.
[303] Spectator No. 2, March 2, 1710-11.
[304] Cunningham, vol. ii. p. 606.
[305] Sir G. Buc, in Howes, p. 1076, ed. 1631.
[306] Trivia.
[307] Smith’s Streets of London, vol. i. p. 338.
[308] Hone’s Every-day Book, vol. i. p. 1300.
[309] Walpole’s Anecdotes of Painting, vol. ii. p. 612.
[310] No. 102.
[311] Pennant’s London (1813), p. 204.
[312] Spectator, No. 454.
[313] Spectator, No. 454.
[314] Andrews’s History of Journalism, vol. ii. p. 8.
[315] Brayley’s Theatres of London (1826), p. 40.
[316] Brayley, p. 42.
[317] Chetwood’s History of the Stage, p. 141.
[318] Spectator, No. 468.
[319] Ward’s Secret History of Clubs, ed. 1709.
[320] Victor.
[321] Edwards’s Anecdotes of Painting, p. 20.
[322] Wine and Walnuts, vol. i. p. 110.
[323] P. Cunningham.
[324] Dr. King’s Art of Cookery, humbly inscribed to the Beef-steak
Club. (1709.)
[325] Leigh Hunt’s Town (1859), p. 191.
[326] Cunningham, vol. i. p. 297.
[327] Delaune.
[328] Strype, B. iv. p. 119.
[329] Leigh Hunt’s Town, ch. iv.
[330] Wine and Walnuts, vol. i. p. 281.
[331] Ibid. p. 269.
[332] Wine and Walnuts, vol. i. p. 276.
[333] Cunningham, p. 187.
[334] Whitelocke.
[335] Lockhart’s Life of Scott, vol. vi. p. 20.
[336] The Stage, by Alfred Bunn, vol. iii. p. 131.
[337] Life of Mathews, by Mrs. Mathews (abridged by Mr. Yates), p.
211.
[338] Life of Mathews, by Mrs. Mathews.
[339] Critical Essays (1807), p. 140.
[340] Hazlitt’s Criticisms of the English Stage, p. 98.
[341] Hazlitt’s Criticisms of the English Stage, p. 98.
[342] Cole’s Life of C. Kean, vol. ii. p. 260.
[343] Strype, B. vi. p. 93.
[344] Stow.
[345] Davies’s Life of Garrick, vol. x. p. 217.
[346] Strype, B. vi. p. 93.
[347] Cunningham’s London (1850), p. 219.
[348] Whyte’s Miscellanea Nova, p. 49.
[349] Cunningham, vol. ii. p. 597.—Rate-books of St. Martin’s.
[350] Walpole’s Anecdotes, vol. i. p. 248.
[351] Dixon’s Story of Lord Bacon’s Life, p. 204.
[352] English Causes Célèbres (edited by Craik), vol. i. p. 79.
[353] Memoirs of the Peers of James I., p. 240.
[354] Autobiography of Lord Herbert, p. 110
[355] Suckling’s Poems.
[356] Camden’s Annals of King James.
[357] Londinum Redivivum.
[358] Walpole to Montague, Feb. 2, 1762.
[359] Dix’s Life of Chatterton, p. 267.
[360] Foster’s Life of Goldsmith, p. 216.
[361] Irving’s Oliver Goldsmith (1850), p. 90.
[362] Dr. Waagen’s Treasures of Art, vol. i. p. 394.
[363] Walpole’s Anecdotes, vol. ii. p. 354.
[364] Walpole, vol. i. p. 277.
[365] The Famous Chronicle of King Edward I. (4to., 1593).
[366] Bosworth’s Anglo-Saxon Dictionary.
[367] Hamlet.
[368] Diversions of Purley.
[369] Peele’s Works (Dyce), vii. 575.
[370] Rymer, ii. 498.
[371] Heming, 590.
[372] Walpole, vol. i. p. 32.
[373] Gleanings from Westminster Abbey, 2d edition, p. 152 (W.
Burges), Roxburghe Club.
[374] Lilly’s Observations.
[375] Carlyle’s Cromwell, vol. i. p. 99.
[376] State Trials, vol. v. pp. 1234-5.
[377] Narcissus Luttrell.
[378] Overseers’ Books (Cunningham, vol. i. p. 179).
[379] Harl. MSS. 7315.
[380] Carpenter (quoted by Walpole, Anecdotes, vol. ii. p. 395).
[381] Walpole’s Anecdotes, vol. ii. p. 394.
[382] Smith’s Streets of London, vol. i. p. 139.
[383] Archenholz, Tableau de l’Angleterre, vol. ii. p. 164, 1788.
[384] Burnet, vol. ii. p. 53, ed. 1823.
[385] Annual Register (1810).
[386] Cobbett’s State Trials, vol. xvii. p. 160.
[387] Archenholz, vol. i. p. 166.
[388] Daily Advertiser, 1731.
[389] Gentleman’s Magazine, vol. i.
[390] v. 85.
[391] Hogarth’s Works (Nicholls and Steevens), vol. i. p. 162.
[392] Smith’s London, vol. i. p. 141.
[393] Notes and Queries (vol. vi., 1858), p. 364.
[394] Dunciad, B. iv. 30.
[395] Pope’s Works (edited by R. Carruthers), vol. ii. p. 314.
[396] Stow, p. 167.
[397] Report, May 16, 1844.
[398] Smith’s London, vol. i. p. 133.
[399] Dr. Waagen, vol. i. p. 6.
[400] Waagen, vol. i. p. 322.
[401] Ibid. vol. i. p. 331.
[402] Cunningham, nearly always correct, says £10,000 (vol. ii. p.
577).
[403] Waagen, vol. ii. p. 329.
[404] Cunningham’s London, p. 428.
[405] Smith’s Streets of London, vol. i. p. 153.
[406] Rate-books of St. Martin’s (Cunningham).
[407] MSS., Birch, 4221, quoted in the notes of the Tatler.
[408] “Country Wife.”
[409] “The Scowrers.”
[410] State Poems.
[411] “The Hind and the Panther Transversed.”
[412] “The Relapse.”
[413] The Art of Cookery.
[414] Weekly Journal, Nov. 21, 1724.
[415] London Gazette, June 4, 1688.
[416] Dunciad, B. ii. v. 411.
[417] Flying Post, June 23, 1716.
[418] Pope’s Works (Carruthers), vol. ii. pp. 309, 310.
[419] Leigh Hunt’s Essays on the Theatres (1807), p. 64.
[420] Philips’s Life of Milton, p. 32, 12mo, 1694.
[421] Cunningham (1850), p. 107.
[422] Wine and Walnuts, vol. i. p. 163.
[423] Royal Guide to the London Charities, 1878-79.
[424] Life of Dr. John North.
[425] Whitelock, p. 470, ed. 1732.
[426] Burnet, vol. ii. p. 70, ed. 1823.
[427] Boswell (Croker), vol. iii. p. 213.
[428] Willis’s History of the See of Llandaff.
[429] Bartholomew Fair (Ben Jonson).
[430] Gifford’s Ben Jonson, iv. p. 430.
[431] Cunningham, vol. ii. p. 505.
[432] The World, Nov. 29, 1753.
[433] Robson: a Sketch (Hotten, 1864).
[434] Aubrey, iii. 415.
[435] “Treacherous Brothers,” 4to, 1696.
[436] St. James’s Chronicle, April 24, 1762.
[437] Ibid. May 26, 1761.
[438] Edwards’ Anecdotes, pp. 116, 117.
[439] Rate-books of St. Martin’s.
[440] Lord Orford’s Anecdotes of Painting.
[441] J. C. Jeaffreson’s Book about Doctors, p. 109.
[442] Ath. Ox. vol. ii.
[443] Gifford’s Ben Jonson, vol. ix. pp. 48, 63, 64.
[444] Aubrey’s Letters, vol. ii. p. 332.
[445] Recital in grant to the parish from King James I.
[446] Cunningham’s London (1849), vol. ii. p. 526.
[447] Burnet’s Own Times, vol. i. p. 327, ed. 1823.
[448] Allan Cunningham’s Lives, vol. iv. p. 290.
[449] Biog. Brit.
[450] Smith’s Life of Nollekens, vol. ii. p. 233.
[451] Smith’s Book for a Rainy Day, pp. 251, 252.
[452] Prologues to the Satires, v. 180.
[453] Dr. Johnson’s Life of Ambrose Philips.
[454] Smith’s Nollekens and his Times, vol. ii. p. 222.
[455] Cunningham (1850), p. 450.
[456] Smith’s Streets, vol. ii. p. 208.
[457] Smith, vol. ii. p. 97.
[458] Smith, p. 211.
[459] Ibid. vol. ii. p. 212.
[460] Smith, vol. ii. p. 224.
[461] Smith’s Streets of London, vol. ii. p. 226.
[462] Wine and Walnuts, vol. i. p. 178, a curious and amusing book,
the truth in which is spoiled by an injudicious and eccentric mixture
of fiction.
[463] Smith’s Nollekens, vol. i. pp. 93, 94.
[464] Ibid. vol. ii. p. 233.
[465] Smith’s Nollekens, vol. ii. p. 238.
[466] Ibid. p. 241.
[467] Smith’s Nollekens, vol. i. p. 143.
[468] Ibid. vol. ii. p. 244.
[469] Ibid. p. 250.
[470] Recollections of O’Keefe, vol. i. p. 108.
[471] Knowles’s Life of Fuseli, vol. i. p. 57.
[472] Passages of a Working Life, by Charles Knight, vol. i. pp. 114,
115.
[473] Hume’s Learned Societies, pp. 84, 85.
[474] Dr. Hodges’ Letter to a Person of Quality, p. 15.
[475] Defoe’s Journal of the Plague Year.
[476] Dr. Hodges’ Loimologia, p. 7 (from the reprint in 1720, when
the plague was raging in France).
[477] Ibid. pp. 19, 20.
[478] Howes, p. 1048.
[479] Bagford, Harl. MSS. 5900, fol. 50.
[480] Walpole’s Royal and Noble Authors, vol. ii. p. 25.
[481] Evelyn’s Diary (1850), vol. ii. p. 59.
[482] Evelyn’s Diary, vol. ii. p. 153 (1850).
[483] Life of Lord Herbert (1826), p. 304.
[484] Horace Walpole.
[485] Aubrey’s Lives, vol. ii. p. 387.
[486] Walpole’s Anecdotes of Painting (Dallaway), vol. ii. p. 593.
[487] Richardson.
[488] Walpole, vol. ii. p. 563 (partly from Dallaway’s version of the
same story).
[489] Dallaway.
[490] Walpole, vol. ii. p. 594.
[491] Spence.
[492] Aubrey, vol. ii p. 132.
[493] Dallaway’s Notes.
[494] Clarendon, B. ii. p. 2117.
[495] Ibid. B. i. p. 116.
[496] Clarendon, B. viii. p. 694.
[497] Walpole’s Anecdotes of Painting, vol. ii. p. 452.
[498] Doran’s Her Majesty’s Servants, vol. ii. p. 51.
[499] Leigh Hunt’s Town, p. 226.
[500] Ibid. p. 226.
[501] Hazlitt’s Criticisms of the English Stage, p. 49.
[502] O’Keefe’s Life, vol. i. p. 322.
[503] Leigh Hunt, p. 226.
[504] Life of Benjamin Franklin (1826), p. 31.
[505] Life of the Duke of Ormond (1747), pp. 67, 80.
[506] Macaulay, vol. ii. p. 560.
[507] Bramston, p. 339.
[508] Annual Register (1780), pp. 254-287.
[509] Life of Inigo Jones, by P. Cunningham, p. 22 (Shakspere
Society).
[510] Smith’s Nollekens, vol. ii. p. 90.
[511] Cibber’s Lives, vol. ii. p. 10.
[512] Ibid. p. 11.
[513] Cunningham’s London, vol. ii. p. 501.
[514] Dryden’s Works (Scott), vol. i. p. 204.
[515] Scott’s Dryden, vol. xiii. p. 7.
[516] Cibber’s Lives, vol. iv. p. 293.
[517] Wine and Walnuts, vol. ii. p. 277.
[518] Cibber’s Lives, vol. iv. p. 47.
[519] Cibber’s Lives, vol. iv. p. 47.
[520] Mrs. Bray’s Life of Stothard, p. 47.
[521] Defoe’s Journey through England.
[522] Wine and Walnuts, vol. ii. p. 167.
[523] Smith’s Nollekens, vol. i. p. 27.
[524] Times, Sept. 26, 1796.
[525] Talfourd’s Final Memorials of Charles Lamb, vol. i. p. 56.
[526] Burke’s Landed Gentry (1858), p. 320.
[527] Pennant.
[528] Lingard, vol. vi. p. 607.
[529] Walton’s Lives (1852), p. 22.
[530] Angel in the House, by Mr. Coventry Patmore.
[531] Dedication to Translation of Juvenal.
[532] Donne’s Poems (1719), p. 291.
[533] Miss Benger’s Memoirs of the Queen of Bohemia, vol. ii. p.
322.
[534] Miss Benger’s Memoirs of the Queen of Bohemia, vol. ii. p.
428.
[535] Sydney State Papers, vol. ii. p. 723.
[536] Benger, vol. ii. p. 457.
[537] Ibid., Preface.
[538] Brayley’s Londiniana, vol. iv. p. 301.
[539] Walpole’s Anecdotes, p. 210.
[540] Cunningham, vol. i. p. 204.
[541] Wilson’s Life of James I. (1653), p. 146.
[542] Aubrey’s Anecdotes and Traditions, p. 3.
[543] Trivia.
[544] Rate-books of St. Martin’s, quoted by P. Cunningham.
[545] Granger’s Biographical History of England (1824), vol. v. p.
356.
[546] Pepys’s Memoirs, vol. iii. p. 75.
[547] Curll’s History of the English Stage, vol. i. p. III.
[548] Miscellaneous Works by the late Duke of Buckingham, etc., p.
35 (1704).
[549] Miscellaneous Works by the late Duke of Buckingham, etc.,
vol. i. p. 34.
[550] Burnet’s History of his own Times (1753), vol. i. p. 387.
[551] Leigh Hunt’s Town (1859), p. 282.
[552] Evelyn’s Mems. vol. ii. p. 339.
[553] Collier, iii. 328.
[554] Prynne’s Histrio-Mastix (1633).
[555] Pepys (May 8, 1663).
[556] Cibber’s Apology, p. 338. ed. 1740.
[557] Doran, vol. i. p. 57.
[558] Dec. 7, 1666.
[559] Jan. 23, 1667.
[560] April 20, 1667.
[561] Doran, p. 97.
[562] Doran, vol. i. p. 79.
[563] Leigh Hunt, p. 267.
[564] Cibber’s Apology, 250.
[565] Doran, vol. i. p. 466.
[566] Tatler, No. 182.
[567] Doran, vol. i. p. 464.
[568] Cumberland’s Memoirs, p. 59.
[569] Davies’s Miscellanies, vol. i. p. 126.
[570] Doran, vol. ii. p. 126.
[571] Ibid. p. 149.
[572] Doran, vol. i. p. 511.
[573] Ibid. vol. ii. p. 7.
[574] Dr. Doran, vol. ii. p. 277.
[575] Dr. Doran’s Knights and their Days.
[576] Elia, p. 217.
[577] Doran, vol. ii. p. 330.
[578] Leigh Hunt’s Essays on the Theatres, p. 124.
[579] Hazlitt’s Essays, p. 47.
[580] Elia, p. 216.
[581] Moore’s Sheridan, p. 140.
[582] Ibid. p. 181.
[583] Murphy’s Garrick.
[584] Doran, vol. ii. p. 489.
[585] Leigh Hunt’s Essays on the Theatres, p. 124.
[586] Ibid. p. 78.
[587] Hazlitt’s Criticisms of the Stage, p. 441.
[588] Elia, p. 221.
[589] Doran, vol. ii. p. 476.
[590] Hazlitt’s Essays, p. 47.
[591] Hazlitt’s Criticisms, pp. 49, 50.
[592] Elia (1853), p. 206.
[593] Elia, p. 232.
[594] Ibid. p. 213.
[595] Moore’s Life of Sheridan, p. 637.
[596] Moore’s Sheridan, p. 637.
[597] Smith’s Nollekens, vol. ii. p. 113.
[598] Hazlitt’s Essays, p. 51.
[599] Ibid. p. 212.
[600] The Georgian Era, vol. iv. p. 43.
[601] Hazlitt’s Essays, p. 49.
[602] Lounger’s Commonplace Book, vol. ii. p. 137.
[603] Dunciad, B. iii. p. 199.
[604] Lounger’s Commonplace Book, vol. ii. p. 141.
[605] The Intelligencer, No. 3.
[606] Leigh Hunt’s Town, p. 248.
[607] Fly Leaves (Miller), vol. i. p. 96.
[608] Disraeli’s Miscellanies, p. 77.
[609] Wine and Walnuts, vol. ii. p. 150.
[610] Jeaffreson’s Book about Doctors (2d ed.), p. 85.
[611] The very earliest was granted to Philip the Hermit, for
gravelling the road at Highgate.
[612] Rymer’s Fœdera.
[613] Fuller’s Church History.
[614] Vaughan’s Life of Wickliffe.
[615] Dobie’s St. Giles’s, p. 11.
[616] Ibid. (1829), p. 2.
[617] Pennant (4th ed.), p. 3.
[618] Butler’s Lives of the Saints.
[619] Aggas’s Map, published in 1578 or 1560.
[620] Stow’s Survey, 1595.
[621] Dobie’s St. Giles’s, p. 46.
[622] Evelyn’s Diary.
[623] Brayley’s Londiniana.
[624] Dobie’s St. Giles’s, pp. 58, 59.
[625] Defoe’s History of the Plague.
[626] Maitland’s History of London.
[627] Dr. Sydenham.
[628] Dr. Hodgson’s Journal of the Plague.
[629] Dr. Hodges on the Plague.
[630] Fuller’s Church History.
[631] Hume.
[632] Fuller.
[633] Parliamentary Report.
[634] Ralph.
[635] Rowland Dobie’s History of St. Giles’s, p. 119.
[636] Pennant’s London, p. 159.
[637] Cunningham’s London, vol. i. p. 339.
[638] Annual Register, 1827.
[639] Dobie’s St. Giles’s, p. 367.
[640] Strype.
[641] Strype.
[642] Dobie’s St. Giles’s, p. 225.
[643] Cunningham’s London, vol. i. p. 384.
[644] Smith’s Book for a Rainy Day, p. 21.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookball.com