You are on page 1of 3

Errata for “Data Structures” Handouts

Page 29
In Lesson No. 03, Topic Linked List using C++
Change
So, this get() returns the address of the node pointed to by the currentNode pointer.
With
So, this get() returns the value of the node pointed to by the currentNode pointer.

Page 73
In Lesson No. 07, Topic Infix to postfix Conversion
Change
prcd( op, ‘)' ) = FALSE for any operator other than ')'
With
prcd( op, '(' ) = FALSE for any operator other than '('

Page 80
In Lesson No. 08, Topic Function Call Stack
Change
GCC (glue compiler)
With
GCC (GNU Compiler Collection)

Page 125
In Lesson No. 11, Topic Level of a Complete Binary Tree
Change
log2 (100000 + 1) – 1
With
log2 (1000000 + 1) – 1

Page 139
In Lesson No. 13, Topic Cost of Search
Change
log2 (100000 + 1) – 1 = log2 (100001) – 1
With
log2 (1000000 + 1) – 1 = log2 (1000001) – 1
Page 212
In Lesson No. 20, Topic Cost of Search
Change
Suppose we have 100,000 items (number or names) and have built a balanced search tree of these items. In
20 (i.e. log 100000)
comparisons, it will be possible to tell whether an item is there or not in these 100,000 items.
With
Suppose we have 1,000,000 items (number or names) and have built a balanced search tree of these items. In
20 (i.e. log 1000000)
comparisons, it will be possible to tell whether an item is there or not in these 1,000,000 items.

Page 281
In Lesson No. 25, Topic Expression Tree
Change
/* inorder traversal routine using the parenthesis */
void inorder(TreeNode<int>* treeNode)
{
if( treeNode != NULL ){
cout << "(";
inorder(treeNode->getLeft());
cout << ")";
cout << *(treeNode->getInfo());
cout << "(";
inorder(treeNode->getRight());
cout << ")";
}
}
With
/* inorder traversal routine using the parenthesis */
void inorder(TreeNode<int>* treeNode)
{
if( treeNode != NULL )
{
if(treeNode->getLeft() != NULL && treeNode->getRight() != NULL) //if not leaf
cout<<"(";
inorder(treeNode->getLeft());
cout << *(treeNode->getInfo())<<" ";
inorder(treeNode->getRight());
if(treeNode->getLeft() != NULL && treeNode->getRight() != NULL) //if not leaf
cout<<")";
}
}

Page 288
In Lesson No. 25, Topic Huffman Encoding, Last paragraph third line
Change
The ASCII value for ‘a’ is 95
With
The ASCII value for ‘a’ is 97

Page 462
In Lesson No. 41, Topic Examples of Hashing, Third paragraph
Change
H(ABC) = (65 * 7 ^0 + 66 * 7^1 + 67 * 7^2) mod 55 = 45

With
H(ABC) = (65 * 7 ^0 + 66 * 7^1 + 67 * 7^2) mod 55 = 15

You might also like