100% found this document useful (1 vote)
175 views55 pages

Immediate download Problem Solving in Data Structures Algorithms Using C Programming Interview Guide 1st Edition Hemant Jain ebooks 2024

Structures

Uploaded by

helalbunnyil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
100% found this document useful (1 vote)
175 views55 pages

Immediate download Problem Solving in Data Structures Algorithms Using C Programming Interview Guide 1st Edition Hemant Jain ebooks 2024

Structures

Uploaded by

helalbunnyil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 55

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Problem Solving in Data Structures Algorithms


Using C Programming Interview Guide 1st Edition
Hemant Jain

https://textbookfull.com/product/problem-solving-in-data-
structures-algorithms-using-c-programming-interview-
guide-1st-edition-hemant-jain/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Problem Solving in Data Structures Algorithms Using C


Programming Interview Guide First Edition Hemant Jain

https://textbookfull.com/product/problem-solving-in-data-structures-
algorithms-using-c-programming-interview-guide-first-edition-hemant-
jain/
textboxfull.com

Problem Solving in Data Structures & Algorithms Using C


First Edition Jain

https://textbookfull.com/product/problem-solving-in-data-structures-
algorithms-using-c-first-edition-jain/

textboxfull.com

Data Structures Algorithms in Go 1st Edition Hemant Jain

https://textbookfull.com/product/data-structures-algorithms-in-go-1st-
edition-hemant-jain/

textboxfull.com

Python Programming Using Problem Solving Approach Thareja


Reema

https://textbookfull.com/product/python-programming-using-problem-
solving-approach-thareja-reema/

textboxfull.com
C++ Programming. Program Design including Data Structures
D.S. Malik

https://textbookfull.com/product/c-programming-program-design-
including-data-structures-d-s-malik/

textboxfull.com

Data Structures with C Programming 2nd Edition Anil Kumar


Yadav

https://textbookfull.com/product/data-structures-with-c-
programming-2nd-edition-anil-kumar-yadav/

textboxfull.com

Data Structures and Algorithms with the C++ STL: A guide


for modern C++ practitioners 1 / converted Edition John
Farrier
https://textbookfull.com/product/data-structures-and-algorithms-with-
the-c-stl-a-guide-for-modern-c-practitioners-1-converted-edition-john-
farrier/
textboxfull.com

Data Structures Algorithms in Kotlin Implementing


Practical Data Structures in Kotlin 1st Edition
Raywenderlich Tutorial Team
https://textbookfull.com/product/data-structures-algorithms-in-kotlin-
implementing-practical-data-structures-in-kotlin-1st-edition-
raywenderlich-tutorial-team/
textboxfull.com

Data Structures & Algorithms in Python John Canning

https://textbookfull.com/product/data-structures-algorithms-in-python-
john-canning/

textboxfull.com
Problem Solving in
Data Structures &
Algorithms Using
C++
First Edition

By Hemant Jain
Problems Solving in Data Structures & Algorithms Using C++
HEMANT JAIN

Copyright © 2016 by HEMANT JAIN. All Right Reserved.

No part of this publication may be reproduced, distributed, or transmitted in any


form or by any means, including photocopying, recording, or other electronic or
mechanical methods, or by any information storage and retrieval system without
the prior written permission of the author, except in the case of very brief
quotations embodied in critical reviews and certain other non-commercial uses
permitted by copyright law.
ACKNOWLEDGEMENT
The author is very grateful to GOD ALMIGHTY for his grace and blessing.

Deepest gratitude for the help and support of my brother Dr. Sumant Jain. This
book would not have been possible without the support and encouragement he
provided.

I would like to express profound gratitude to my guide/ my friend Naveen


Kaushik for his invaluable encouragement, supervision and useful suggestion
throughout this book writing work. His support and continuous guidance enable
me to complete my work successfully.

Last but not least, I am thankful to Anil Berry and Others who helped me
directly or indirectly in completing this book.

Hemant Jain
TABLE OF CONTENTS
TABLE OF CONTENTS
TABLE OF CONTENTS
CHAPTER 0: HOW TO USE THIS BOOK
WHAT THIS BOOK IS ABOUT
PREPARATION PLANS
SUMMARY
CHAPTER 1: INTRODUCTION - PROGRAMMING OVERVIEW
INTRODUCTION
FIRST C++ PROGRAM
OBJECT
VARIABLE
PARAMETER PASSING, CALL BY VALUE
PARAMETER PASSING, CALL BY REFERENCE
PARAMETER PASSING, CALL BY POINTER
KINDS OF VARIABLES
METHODS
ACCESS MODIFIERS
ABSTRACT CLASS
RELATIONSHIP
GENERAL PROTOTYPE OF A CLASS
NESTED CLASS
ENUMS
CONSTANTS
CONDITIONS AND LOOPS
ARRAY
VECTOR
ARRAY INTERVIEW QUESTIONS
CONCEPT OF STACK
SYSTEM STACK AND METHOD CALLS
RECURSIVE FUNCTION
EXERCISES
CHAPTER 2: ALGORITHMS ANALYSIS
INTRODUCTION
ASYMPTOTIC ANALYSIS
BIG-O NOTATION
OMEGA-Ω NOTATION
THETA-Θ NOTATION
COMPLEXITY ANALYSIS OF ALGORITHMS
TIME COMPLEXITY ORDER
DERIVING THE RUNTIME FUNCTION OF AN ALGORITHM
TIME COMPLEXITY EXAMPLES
MASTER THEOREM
MODIFIED MASTER THEOREM
EXERCISE
CHAPTER 3: APPROACH TO SOLVE ALGORITHM DESIGN
PROBLEMS
INTRODUCTION
CONSTRAINTS
IDEA GENERATION
COMPLEXITIES
CODING
TESTING
EXAMPLE
SUMMARY
CHAPTER 4: ABSTRACT DATA TYPE & C++ COLLECTIONS
ABSTRACT DATA TYPE (ADT)
DATA-STRUCTURE
C++ COLLECTION FRAMEWORK
ARRAY
LINKED LIST
STACK
QUEUE
TREES
BINARY TREE
BINARY SEARCH TREES (BST)
PRIORITY QUEUE (HEAP)
HASH-TABLE
DICTIONARY / SYMBOL TABLE
GRAPHS
GRAPH ALGORITHMS
SORTING ALGORITHMS
COUNTING SORT
END NOTE
CHAPTER 5: SEARCHING
INTRODUCTION
WHY SEARCHING?
DIFFERENT SEARCHING ALGORITHMS
LINEAR SEARCH – UNSORTED INPUT
LINEAR SEARCH – SORTED
BINARY SEARCH
STRING SEARCHING ALGORITHMS
HASHING AND SYMBOL TABLES
HOW SORTING IS USEFUL IN SELECTION ALGORITHM?
PROBLEMS IN SEARCHING
EXERCISE
CHAPTER 6: SORTING
INTRODUCTION
TYPE OF SORTING
BUBBLE-SORT
MODIFIED (IMPROVED) BUBBLE-SORT
INSERTION-SORT
SELECTION-SORT
MERGE-SORT
QUICK-SORT
QUICK SELECT
BUCKET SORT
GENERALIZED BUCKET SORT
HEAP-SORT
TREE SORTING
EXTERNAL SORT (EXTERNAL MERGE-SORT)
COMPARISONS OF THE VARIOUS SORTING ALGORITHMS.
SELECTION OF BEST SORTING ALGORITHM
EXERCISE
CHAPTER 7: LINKED LIST
INTRODUCTION
LINKED LIST
TYPES OF LINKED LIST
SINGLY LINKED LIST
DOUBLY LINKED LIST
CIRCULAR LINKED LIST
DOUBLY CIRCULAR LIST
EXERCISE
CHAPTER 8: STACK
INTRODUCTION
THE STACK ABSTRACT DATA TYPE
STACK USING ARRAY
STACK USING ARRAY (GROWING-REDUCING CAPACITY
IMPLEMENTATION)
STACK USING LINKED LIST
PROBLEMS IN STACK
PROS AND CONS OF ARRAY AND LINKED LIST IMPLEMENTATION
OF STACK.
USES OF STACK
EXERCISE
CHAPTER 9: QUEUE
INTRODUCTION
THE QUEUE ABSTRACT DATA TYPE
QUEUE USING ARRAY
QUEUE USING LINKED LIST
PROBLEMS IN QUEUE
EXERCISE
CHAPTER 10: TREE
INTRODUCTION
TERMINOLOGY IN TREE
BINARY TREE
TYPES OF BINARY TREES
PROBLEMS IN BINARY TREE
BINARY SEARCH TREE (BST)
PROBLEMS IN BINARY SEARCH TREE (BST)
EXERCISE
CHAPTER 11: PRIORITY QUEUE
INTRODUCTION
TYPES OF HEAP
HEAP ADT OPERATIONS
OPERATION ON HEAP
HEAP-SORT
USES OF HEAP
PROBLEMS IN HEAP
EXERCISE
CHAPTER 12: HASH-TABLE
INTRODUCTION
HASH-TABLE
HASHING WITH OPEN ADDRESSING
HASHING WITH SEPARATE CHAINING
COUNT MAP
PROBLEMS IN HASHING
EXERCISE
CHAPTER 13: GRAPHS
INTRODUCTION
GRAPH REPRESENTATION
ADJACENCY MATRIX
ADJACENCY LIST
GRAPH TRAVERSALS
DEPTH FIRST TRAVERSAL
BREADTH FIRST TRAVERSAL
PROBLEMS IN GRAPH
DIRECTED ACYCLIC GRAPH
TOPOLOGICAL SORT
MINIMUM SPANNING TREES (MST)
SHORTEST PATH ALGORITHMS IN GRAPH
EXERCISE
CHAPTER 14: STRING ALGORITHMS
INTRODUCTION
STRING MATCHING
DICTIONARY / SYMBOL TABLE
PROBLEMS IN STRING
EXERCISE
CHAPTER 15: ALGORITHM DESIGN TECHNIQUES
INTRODUCTION
BRUTE FORCE ALGORITHM
GREEDY ALGORITHM
DIVIDE-AND-CONQUER, DECREASE-AND-CONQUER
DYNAMIC PROGRAMMING
REDUCTION / TRANSFORM-AND-CONQUER
BACKTRACKING
BRANCH-AND-BOUND
A* ALGORITHM
CONCLUSION
CHAPTER 16: BRUTE FORCE ALGORITHM
INTRODUCTION
PROBLEMS IN BRUTE FORCE ALGORITHM
CONCLUSION
CHAPTER 17: GREEDY ALGORITHM
INTRODUCTION
PROBLEMS ON GREEDY ALGORITHM
CHAPTER 18: DIVIDE-AND-CONQUER, DECREASE-AND-CONQUER
INTRODUCTION
GENERAL DIVIDE-AND-CONQUER RECURRENCE
MASTER THEOREM
PROBLEMS ON DIVIDE-AND-CONQUER ALGORITHM
CHAPTER 19: DYNAMIC PROGRAMMING
INTRODUCTION
PROBLEMS ON DYNAMIC PROGRAMMING ALGORITHM
CHAPTER 20: BACKTRACKING AND BRANCH-AND-BOUND
INTRODUCTION
PROBLEMS ON BACKTRACKING ALGORITHM
CHAPTER 21: COMPLEXITY THEORY AND NP COMPLETENESS
INTRODUCTION
DECISION PROBLEM
COMPLEXITY CLASSES
CLASS P PROBLEMS
CLASS NP PROBLEMS
CLASS CO-NP
NP–HARD:
NP–COMPLETE PROBLEMS
REDUCTION
END NOTE
CHAPTER 22: INTERVIEW STRATEGY
INTRODUCTION
RESUME
NONTECHNICAL QUESTIONS
TECHNICAL QUESTIONS
CHAPTER 23: SYSTEM DESIGN
SYSTEM DESIGN
SYSTEM DESIGN PROCESS
SCALABILITY THEORY
DESIGN SIMPLIFIED FACEBOOK
DESIGN A SHORTENING SERVICE LIKE BITLY
STOCK QUERY SERVER
DESIGN A BASIC SEARCH ENGINE DATABASE
DUPLICATE INTEGER IN MILLIONS OF DOCUMENTS
ZOMATO
YOUTUBE
DESIGN IRCTC
ALARM CLOCK
DESIGN FOR ELEVATOR OF A BUILDING
VALET PARKING SYSTEM
OO DESIGN FOR A MCDONALDS SHOP
OBJECT ORIENTED DESIGN FOR A RESTAURANT
OBJECT ORIENTED DESIGN FOR A LIBRARY SYSTEM
SUGGEST A SHORTEST PATH
EXERCISE
APPENDIX
APPENDIX A
INDEX
CHAPTER 0: HOW TO USE THIS
BOOK
What this book is about
This book is about usage of data structures and algorithms in computer
programming. Data structures are the ways in which data is arranged in
computers memory. Algorithms are set of instructions to solve some problem by
manipulating these data structures.

Designing an efficient algorithm to solve a computer science problem is a skill


of Computer programmer. This is the skill which tech companies like Google,
Amazon, Microsoft, Facebook and many others are looking for in an interview.
Once we are comfortable with a programming language, the next step is to learn
how to write efficient algorithms.

This book assumes that you are a C++ language developer. You are not an expert
in C++ language, but you are well familiar with concepts of pointers, references,
functions, arrays and recursion. At the start of this book, we will be revising the
C++ language fundamentals that will be used throughout this book. In the
chapter 1 we will be looking into some of the problems in arrays and recursion
too.

Then in the coming chapter we will be looking into Complexity Analysis.


Followed by the various data structures and their algorithms. Will look into a
Linked-List, Stack, Queue, Trees, Heap, Hash-Table and Graphs. We will also be
looking into Sorting, Searching techniques.

And we will be looking into algorithm analysis of various algorithm techniques,


such as Brute-Force algorithms, Greedy algorithms, Divide and Conquer
algorithms, Dynamic Programming, Reduction and Back-Tracking.

In the end, we will be looking into System Design that will give a systematic
approach to solve the design problems in an Interview.
Preparation Plans
Given the limited time you have before your next interview, it is important to
have a solid preparation plan. The preparation plan depends upon the time and
which companies you are planning to target. Below are the three-preparation
plan for 1 Month, 3 Month and 5 Month durations.

1 Month Preparation Plans


Below is a list of topics and approximate time user need to take to finish these
topics. These are the most important chapters that must to be prepared before
appearing for an interview.

This plan should be used when you have a small time before an interview. These
chapters cover 90% of data structures and algorithm interview questions. In this
plan since we are reading about the various ADT and C++ collections in chapter
4 so we can use these datatype easily without knowing the internal details how
they are implemented.
Chapter 24 is for system design, you must read this chapter if you are three or
more years of experienced. Anyway, reading this chapter will give the reader a
broader perspective of various designs.

Time Chapters Explanation


Week 1 Chapter 1: Introduction - You will get a basic understanding of
Programming Overview how to find complexity of a solution.
Chapter 2: Algorithms Analysis You will know how to handle new
Chapter 3: Approach To Solve problems. You will read about a variety
Algorithm Design Problems of datatypes and their uses.
Chapter 4: Abstract Data Type &
C++ Collections
Week 2 Chapter 5: Searching Searching, Sorting and String algorithm
Chapter 6: Sorting consists of a major portion of the
Chapter 14: String Algorithms interviews.
Week 3 Chapter 7: Linked List Linked list, Stack and Queue are one of
Chapter 8: Stack the favorites in an interview.
Chapter 9: Queue
Week 4 Chapter 10: Tree This portion you will read about Trees
Chapter 23: Interview Strategy and System Design. You are good to go
Chapter 24: System Design for interviews. Best of luck.

3 Month Preparation Plan


This plan should be used when you have some time to prepare for an interview.
This preparation plan includes nearly everything in this book except various
algorithm techniques. Algorithm problems that are based on dynamic
programming divide & conquer etc. Which are asked in vary specific companies
like Google, Facebook, etc. Therefore, until you are planning to face interview
with them you can park these topics for some time and focus on the rest of the
topics.

Again, same thing here with system design problems, the more experience you
are, the more important this chapter becomes. However, if you are a fresher from
college, then also you should read this chapter.

Time Chapters Explanation


Week 1 Chapter 1: Introduction - You will get a basic understanding of
Programming Overview how to find complexity of a solution.
Chapter 2: Algorithms You will know how to handle new
Analysis problems. You will read about a
Chapter 3: Approach To Solve variety of datatypes and their uses.
Algorithm Design Problems
Chapter 4: Abstract Data Type &
C++ Collections
Week 2 Chapter 5: Searching Searching, sorting and string algorithm
& Week Chapter 6: Sorting consists of a major portion of the
3 Chapter 14: String Algorithms interviews.
Week 4 Chapter 7: Linked List Linked list, Stack and Queue are one
& Week Chapter 8: Stack of the favorites in an interview.
5 Chapter 9: Queue
Week 6 Chapter 10: Tree This portion you will read about trees
& Week Chapter 11: Heap and heap data structures.
7
Week 8 Chapter 12: Hash-Table Hash-Table is used throughout this
& Week Chapter 13: Graphs book in various places, but now it’s
9 time to understand how Hash-Table
are actually implemented.
Graphs are used to propose a solution
many real life problems.
Week 10 Chapter 23: Interview Strategy Interview strategy and system design
Chapter 24: System Design chapter are the final chapters of this
course.
Week 11 Revision of the chapters listed At this time, you need to revise all the
& Week above. chapters that we have seen in this
12 book. Whatever is left needs to be
completed and the exercise that may
be left needing to be solved in this
period of time.

5 Month Preparation Plan


In this preparation plan is made on top of 3-month plan. In this plan, the students
should look for algorithm design chapters. In addition, in the rest of the time
they need to practice more and more from www.topcoder.com and other
resources. If you are targeting google, Facebook, etc., Then it is highly
recommended to join topcoder and practice as much as possible.

Time Chapters Explanation


Week 1 Chapter 1: Introduction - You will get a basic understanding of how to
Week 2 Programming Overview find complexity of a solution. You will know
Chapter 2: Algorithms how to handle new problems. You will read
Analysis about a variety of datatypes and their uses.
Chapter 3: Approach To
Solve Algorithm Design
Problems
Chapter 4: Abstract Data
Type & C++ Collections
Week 3 Chapter 5: Searching Searching, sorting and string algorithm
Week 4 Chapter 6: Sorting consists of a major portion of the interviews
Week 5 Chapter 14: String
Algorithms
Week 6 Chapter 7: Linked List Linked list, Stack and Queue are one of the
Week 7 Chapter 8: Stack favorites in an interview
Week 8 Chapter 9: Queue
Week 9 Chapter 10: Tree This portion you will read about trees and
Week 10 Chapter 11: Heap priority queue
Week 11 Chapter 12: Hash-Table Hash-Table is used throughout this book in
Week 12 Chapter 13: Graphs various places, but now it’s time to
understand how Hash-Table are actually
implemented.
Graphs are used to propose a solution many
real life problems
Week 13 Chapter 15: Algorithm These chapters contain various algorithms
Week 14 Design Techniques types and their usage. Once the user is
Week 15 Chapter 16: Brute Force familiar with most of this algorithm. Then
Week 16 Chapter 17: Greedy the next step is to start solving topcoder
Algorithm problems from topcode
Chapter 18: Divide-And-
Conquer, Decrease-And-
Conquer
Chapter 19: Dynamic
Programming
Chapter 20: Backtracking
And Branch-And-Bound
Chapter 21: Complexity
Theory And Np
Completeness
Week 17 Chapter 22: Interview Interview strategy and system design chapter
Week 18 Strategy are the final chapters of this course
Chapter 23: System Design
Week 19 Revision of the chapters At this time, you need to revise all the
Week 20 listed above chapters that we have seen in this book.
Whatever is left needs to be completed and
the exercise that may be left needing to be
solved in this period
Summary
These are few preparation plans that can be followed to complete this book there
by preparing for the interview. It is highly recommended that the user should
read the problem statement first, then he should try to solve the problems by
himself and then only he should look into the solution to find the approach of the
book. Practicing more and more problems will increase your thinking capacity
and you will be able to handle new problems in an interview. System design is a
topic that is not asked much from a fresher from college, but as you gain
experience its importance increase. We will recommend practicing all the
problems given in this book, then solve more and more problems from online
resources like www.topcoder.com, www.careercup.com, www.geekforgeek.com
etc.
CHAPTER 1: INTRODUCTION -
PROGRAMMING OVERVIEW
Introduction
This chapter emphasizes on brush up of the fundamentals of the C++
Programming language. It will talk about variables, pointers, references, classes,
loops, recursion, arrays etc. We assume that the reader is familiar with the syntax
of the C++ programming language and knows the basics of Object-Orientation.
First C++ Program

Example 1.1:
#include <iostream>

int main(int argc, char* argv[])


{
//Single Line comment.

/*
Multiple line comments.
*/

std::cout << "Hello, World!" << std::endl;


return 0;
}

It is tradition to discuss a HelloWorld program in the start which will print the
phrase “Hello, World!” to the output screen. So let us start discussing it. This is a
small program but it contains many common features of all the C++ programs.

1. This program begins with “#include <iostream>”:


a. This tells the compiler that we are going to use the functions defined
in iostream file. Cpp language provide a number of predefined files,
which contain functions that are commonly used by programmer.
For example std::cout is defined inside iostream file which will be
used to print “Hello, World!” to the output screen.
2. Next comes the method “int main(int argc, char* argv[])”:
a. A method is a set of statements that are executed to give desire
result.
b. main() is a special method of a class this is the entry point of the
application.
c. The int keyword means that this method is going to return an integer
value in our case it is 0.
3. Next are the comments, which are for readability of the program and are
ignored by the compiler.
a. A single line comment begins with two forward slash //
b. A multiline comment begins with /* and ends with */.
4. “std::cout << "Hello, World!" << std::endl;”, is a system provided
operator(object) which will print “Hello, World! ” to the standard output
and will print next line char in the end.

5. In the end there is a “return 0;” which will give return value to the caller
of the main function. Return statement is a way to pass the return value to
the caller of the function.
Object
An Object is an entity with state and behavior. A cat, a dog, a bulb etc are all
examples of objects. For example a bulb have two states (on, off) and the two
behaviors (turn on, turn off).

Software objects are just like real world objects. They have state in the form of
member variables called fields (isOn) and they expose behavior in the form of
member functions called methods (turn on, turn off).

Hiding internal details (state) of the object and allowing all the actions to be
performed over the objects using methods is known has data-encapsulation.

A Class is a prototype (blueprint) of objects. An object is an instance of a class.


Human is a class of living being and a person named John is an instance of
human class.

Example 1.2:
class Bulb
{
private:
// Instance Variables
bool isOn;

public:
// Constructor
Bulb();

// Instance Method
virtual void turnOn();

// Instance Method
virtual void turnOff();

// Instance Method
virtual bool isOnFun();
};

In this example, we have a class name Bulb. It has a member variable isOn,
which indicates its state that the bulb is on or off. It has two methods turnOn()
and turnoff() which will change the state of the object from off to on and vice
versa.
Variable
"Variables" are simply storage locations for data. For every variable, some
memory is allocated. The size of this memory depends on the type of the
variable.

Example 1.3:
void variableExample()
{
int var1, var2, var3;
var1 = 100;
var2 = 200;
var3 = var1 + var2;
std::cout << "Adding " << var1 << " and " << var2 << " will give " << var3 << std::endl;
}

Analysis:
· Memory is allocated for variables var1, var2 and var3. Whenever we
declare a variable, then memory is allocated for storing the value in the
variable. In our example, 4 bytes are allocated for each of the variable.
· Value 100 is stored in variable var1 and value 200 is stored in variable
var2.
· Value of var1 and var2 is added and stored in var3.
· Finally, the value of var1, var2 and var3 is printed to screen using
std::cout.
Parameter passing, Call by value
Arguments can be passed from one method to other using parameters. By default
all, the variables, which are passed as parameters, are passed-by-value. That
means a separate copy is created inside the called method and no changes done
inside called method will reflect in calling method.

Example 1.4:
void incrementPassByValue(int var)
{
var++;
}

int main()
{
int i = 10;
std::cout << "Value of i before increment is : " << i << std::endl;
incrementPassByValue(i);
std::cout << "Value of i after increment is : " << i << std::endl;
}

Output:
Value of i before increment is : 10
Value of i after increment is : 10

Analysis:
· Variable ”i” is declared and the value 10 is initialized to it.
· Value of ”i” is printed.
· Increment method is called. When a method is called the value of the
parameter is copied into another variable of the called method. Flow of
control goes to increase() function.
· Value of var is incremented by 1. However, remember, it is just a copy
inside the increment method.
· When the method exits, the value of ”i” is still 10.

Points to remember:
1. Pass by value just creates a copy of variable.
2. Pass by value, value before and after the method call remain same.
Parameter passing, Call by Reference
If you need to change the value of the parameter inside the method, then you
should use call by reference. C++ language by default passes by value.
Therefore, to make it happen, you need to pass by reference by using “&”
operator. The variable inside the called function also refer to the same variable
inside the calling function. When the value of reference variable is changed then
the original variable value also change.

Example 1.5:
void incrementPassByReference(int& var)
{
var++;
}

int main()
{
int i = 10;
std::cout << "Value of i before increment is : " << i << std::endl;
incrementPassByReference(i);
std::cout << "Value of i after increment is : " << i << std::endl;
}

Output:
Value of i before increment is : 10
Value of i after increment is : 11

Analysis: Variable “i” is passed as pass by reference, so variable “i” inside


calling function and variable “var” inside called function are the same. So value
of var changed inside called function will also be reflected into the variable “i”
inside calling function.
Parameter passing, Call by Pointer
When we pass address of variable inside calling function to the called function
then the changes done inside called function is also reflected inside calling
function.

Example 1.6:
void incrementPassByPointer(int* ptr)
{
(*ptr)++;
}

int main()
{
int i = 10;
std::cout << "Value of i before increment is : " << i << std::endl;
incrementPassByPointer(&i);
std::cout << "Value of i after increment is : " << i << std::endl;
}

Output:
Value of i before increment is : 10
Value of i after increment is : 11

Analysis: We are passing address of a variable inside calling function to the


called function. Moreover, modifying the value at that address so the change
done is reflected to the calling function variable too.
Exploring the Variety of Random
Documents with Different Content
in vain. There were colors in the weapons such as Miller had never
seen.
“Photon showers,” Llesi told him briefly. “Very high-frequency light
waves with an energy increase great enough to utilize the mass of
the light. Those latticed patterns would be smashed by the impact—if
we could reach them.
“When you deal with anything as delicate as this you need a
delicate weapon. The lattices would be impervious to heavy
weapons but the mass of light itself could crush the patterns if I had
some way to penetrate the cloud.”
“The photons should do it,” Orelle said in a worried voice.
“Always before—”
“Brann has something new this time.”
The cloud rolled on. Through the shattered walls they saw it
engulf the men in its path, moving like a velvet-soft juggernaut that
crushed all before it. It pressed its misty surface against another wall
—there was a surging all through the mass and, briefly, a pattern of
clouded lights glimmered deep in the smoky bulk.
The castle rang with the jangled music of another falling wall.
“It’s making straight for the Power,” Orelle said, quietly now.
“Llesi, you’ve got to stop it.”

Miller felt in his own brain Llesi’s rapid, orderly thoughts,


marshalling the facts and measuring against them his varied
resources. Then, decisively, he spoke.
“We must get to the Power first. I can stop it but we’ll have to
hurry.”
To Miller it seemed as if the castle spun around him again as, in
obedience to the orders in his brain, he whirled and ran with Orelle at
his heels. The corridors opened up before them, unfamiliar pathways
looking strangely familiar to the double vision in his mind. Another
wall smashed into ringing fragments behind them as they ran.
With his new night-sight Miller could see a long way through the
translucent walls of the glass castle. Lights had been kindled through
the building now so that the glimmers, far and near, reflecting
beyond intervening barriers, made the whole castle glow
bewilderingly.
But ahead of them, growing larger as they neared, was one part
of the building that even this new sight could not penetrate. It was a
great cube whose walls gave back the vision opaquely, as it loomed
before them.
Orelle pushed past him as they reached it, spread both hands flat
upon the dark surface. It parted before her, melting away as the
other walls melted to admit entry, and she pressed through into the
hidden room. Miller followed her, his brain spinning with his own
curiosity and the complicated planning of Llesi who shared it.
Afterward Miller could never remember clearly what he had seen
in that great dark room. He had only an impression in retrospect of
an immense number of delicate shining things that might have been
instruments—of countless rows of containers over which light
seemed to ripple and play from within the colored holders, like votive
lights seen far off down the aisle of a cathedral—of things without
name or recognizable shape. . . .
In the center of the room, hanging in the heart of a filligreed
framework which it did not seem to touch anywhere, a clear
transparent cube three feet through floated free. Within it a tilted halo
of—of stars?—rotated slowly through the solid substance of the
block. And very faintly, Miller thought he could hear music as it
turned, the same music he had caught from the night sky, subsonic
but still perceptible to his new senses.
“The Power,” Orelle said, nodding toward the cube.
Miller went forward slowly until he stood by the delicate
framework within which the block floated. He could feel a slight
pressure constantly beating out from the rotating stars, and at the
same time a slight equal suction—an impossible sort of double force
that did not equalize itself but kept him in a continual state of
muscular readjustment to balance the opposite pulls while he stood
within its range.
He was trying to control the excitement that poured through him
at his nearness to this unimaginable thing he had come so far to find.
Slade would give all he had to possess it for, inexplicable as it was,
there was a harnessed power in the mysterious thing unlike any
power at man’s disposal in the lower world beyond Peak Seven
Hundred.
Then, in his brain, Llesi said impatiently, “Later you can examine
it. I need you now, if we’re going to stop Brann’s beast. Turn around
—go to the far wall, reach up to that container of blue light and. . . .”
Miller’s conscious mind ceased to make sense out of the orders
Llesi gave it but his body was obedient. He did not try to resist. He
relaxed his own will and allowed Llesi full control, so that he was only
dimly aware of what his body did in the next few minutes. His hands
were busy, and there was an intense, quiet activity in his mind.
An activity that gradually began to slow. Lights swelled and sank
beneath his busy fingers. Heat and cold and other stranger
sensations he could not name bathed his hands and arms, beat
against his intent face bent above them. But into his mind slowly a
sense of frustration crept.
He made an effort to bring his own mind back into focus and
asked Llesi a quick mental question.
“I don’t know,” Llesi’s mind replied. “It isn’t easy. I think I can stop
the thing but at a cost we can scarcely afford. And I could only do it
once. Brann will know that. He’ll have only to send another just like it
and—” The thought blanked out as if even in his subconsciousness
Llesi did not want to shape the end of that idea.
Miller put forth greater effort and shrugged off the inertia of his
mind which had been necessary while Llesi worked. He was keenly
alert now. He had a job to do.
“Will you listen to me?” he asked. “I think I’ve got an answer—if
you’ll trust me.”
Llesi’s reply was wary but there was eagerness in it too. “What do
you want us to do?”
“Tell me first—can you duplicate this Power source?”

With a double accord both Llesi and Miller turned to gaze at the
floating cube with its lazily rotating halo of glittering light.
“I can, yes,” Llesi said. “Why?”
“Easily? Soon?”
“Not in time to stop Brann’s creature, no. It would take several
hours.”
“Then,” Miller said, bracing himself for the storm he knew must
follow his suggestion, “then I think you’ll have to let the thing
downstairs take your Power and carry it back to Brann.”
There was a mental explosion of fury and refusal.
After it had died down, while Orelle still gazed at him with burning
dark eyes full of distrust and hatred, and Llesi still smouldered angry
thoughts in his brain, Miller went on.
“I know—I know. In your place I’d feel the same. But look at it
dispassionately if you can. Brann has you where he wants you now.
You can only drive off this mechanism downstairs once and Brann
can send another to take the Power source anyhow. If you stay
passive you’re beaten. But listen to me—and maybe you can still
win. Attack! Let the Power go—but follow it.”
There was silence for a moment, while the two others digested
this idea. Then Orelle said, “We could only follow to Brann’s walls.
We’ve never been able to get into his castle and—”
“Don’t you see, this is the only way! He’ll have to make room for
the cube of the Power to enter. If we follow, there ought to be a way
for us to force an entry too. Especially if he doesn’t suspect. Oh, I
know—you think I am Brann. I wish there were some way to—wait!
Could you read my mind if I opened it to you? Would you believe me
then?”
Slowly Orelle said, “I think it might be possible. Are you willing to
let me try?”
Miller hesitated for a moment. There is a curious reluctance in the
human mind to strip aside the last dark barrier that separates each
individual from the world he lives in. The privacy of the mind is so
jealously guarded a secret that not even if a man wills it can he
wholly bare his thoughts to another. But unless Miller let Orelle into
those innermost chambers there was little hope of success for any of
them.
“If I don’t,” he thought, “Brann will win, in the end. And if he wins
—well, I have more to lose than anyone here.” Aloud, in his mental
voice, he said to Orelle, “Yes—try if you’re able.”
She smiled a little. “Let your mind go blank. Don’t offer any
resistance—no, none at all—you are resisting me, Miller. Let me
have the truth. Brann—Brann . . . are you Brann? I must know. . . .”
Her eyes held his and, as they had done once before, began to
grow larger and larger until they blotted out the room and were a
dark pool in which his consciousness was sinking. . . .
“Thank you,” Orelle said quietly. “I’m sorry. You were telling me
the truth all along—unless you’re more cunning than I think you are
and know how to hide your secrets even deeper than the
unconscious mind. I see that you mean us well. I see another thing,
too—why you came here.”
“Yes. You had to know that anyhow. It was why I asked about
duplicating the Power cube.”
“He wants to take it away with him, Llesi,” Orelle said and for the
first time Miller realized that Orelle had been in even closer
communion with his mind than Llesi himself, who dwelt in its very
center. For Llesi had not seen the depths of it—he did not know what
Orelle knew now.
“To take it away?” Llesi demanded, incredulity in his thought. “But
—”
“Yes,” Orelle said quickly. “We could arrange for that, Llesi. If this
plan works well owe him more reward than that.”
“But Orelle,” Llesi persisted, “doesn’t he understand? Doesn’t he
know that—”
The thought ceased abruptly, and Miller had the uneasy feeling
that the two were communicating on some higher plane of silence
where he could not follow them. He was suddenly uneasy. There
was something here he didn’t understand. The two of them knew
something—about himself?—that he did not yet know, something
that affected his future intimately.
“What is it?” he demanded. “If I help you, I’ve a right to know.”
Orelle turned to him, her dark eyes gentle now, the hatred and
mistrust gone out of them. “There isn’t time,” she said. “Listen.”
Far off, but audible through the opaque walls, the tinkle of falling
glass came clearly to them.
“It’s the machine,” Llesi said. “We haven’t time to waste now. If
we follow your plan we mustn’t let it win too easily or Brann will
suspect. Do you have any ideas of what to do after we enter Brann’s
castle?”
“Not yet,” Miller said almost absently. He was thinking hard about
the strange little passage just ended. Until this moment he had not
dared offer to open his whole mind for their inspection, because he
had had nothing to bargain with. Inevitably Orelle would have seen
that he wanted the Power and he had nothing to offer in return—until
now.
Well, it was a success in one way, but in another—failure? He
couldn’t be sure. Oddly the balance had shifted and it was he who
mistrusted his companions and they who believed at last that he
could be depended on. Certainly they were hiding something vital
from him.
“Not yet,” he said again, forcing his mind to take up the
immediate problem as the jangle of another falling barrier came
more loudly through the walls. “I only know it’s easier to work on
inspiration when you’re on the offensive—and once in Brann’s
castle, we’ll need inspiration!
“Brann’s—unbalanced. We know that. Push him farther off
balance by attacking and maybe we’ll have an advantage. You know,
there must be something important he’s hiding or he wouldn’t
operate from the dark as he does. If we can see him face to face—
well, who knows?”
“When you say ‘we’,” Orelle interrupted, “whom do you mean?”
“Myself. Llesi and me.”
“And Orelle,” the girl said quietly.
“Of course not! It’s going to be dangerous. Besides—”
“No more dangerous to go than to wait for Brann’s vengeance if
you fail. Tsi is my sister. I think I can control her and that should be a
weapon you may need. You can’t take more than one or two with
you if you hope to get in secretly so an army would do no good. But
one companion—I think I could be useful to you, Miller.”
“Llesi,” Miller said to the voice in his brain, “what do you think?”
There was silence for a moment. “Let her come,” Llesi said.
“What she says about Tsi is true enough. We may need her.”
In the quiet a musical ringing of more breaking glass sounded
clearer than before.
“It’s coming,” Llesi said. “Now we have work to do. Are you ready,
Miller? Take down that lens mounted on the tesseract and do as I tell
you. We mustn’t let the machine win without a struggle. . . .”
CHAPTER VII
Battle of the Titans
In the light of earliest dawn they could see it rolling toward them
far off across the plain. Crouching under the loom of Brann’s castle
walls, Miller and Orelle waited almost in silence. It had seemed
wisest to hurry ahead by teleportation and take shelter while Brann
was presumably occupying all his powers with the direction of his
mechanical warrior as it broke down the walls of the Power chamber
and seized at last the thing he had sought so long.
Now the two watchers—three, for Llesi waited in Miller’s brain—
saw the lazily turning halo of pointed lights which was the Power
glowing through the cloudiness of the machine that carried it. Faintly
the soundless music of its turning floated to their ears.
“We’ll have no time to waste,” Llesi warned them. “Brann’s
wanted the Power for a purpose, you know. Once he learns how to
use it there’ll be no hope of controlling him. Whatever we do we must
do fast.”
“Can he learn quickly how to operate it?” Miller asked.
“You’re thinking of yourself.” Llesi sounded amused. “Yes, it can
be mastered without too much difficulty. But don’t think about it now,
Miller. You have our promise. Be content with that.”
Miller stirred restlessly. “You’re hiding something. I’ve opened my
mind to you, Orelle. If I deserve any reward for what I’m helping you
do I deserve the truth from you. What is it?”
Orelle shook her head. “Don’t ask us now. I’ll tell you if we come
out of this alive. But it will only distract you now. I promise you it’s
nothing that will affect our plans to conquer Brann. You need all your
thoughts to do that. Afterward there’ll be time to talk of other things.
Look—it’s nearly here. I wonder where Brann means to let it into the
castle.”
The music of the turning stars was clearer now. Miller could feel
remotely that extraordinary attraction-repulsion action which the
Power constantly exerted—it was so near to them as they crouched
in hiding. The machine rolled its cloudy bulk past them, almost
brushing their faces with the periphery of its mist, and moved up over
the jumble of rocks that bordered Brann’s castle.
It pressed close against the surface of the wall. Light glowing
down from that extraordinary barrier which ran like water and shone
like fire cast colored shadows upon the mist, so that it was like a
cumulus of sunset-lighted cloud as it flattened itself against the wall.
Miller could see Orelle’s anxious face lighted with strange hues
from the water-wall as she watched. He held his breath.
Within the sunset cloud patterns of latticed diamond moved and
shifted. The wall surface dimmed as if a breath had blown upon it.
Darkness grew where the dimness was—and suddenly a door had
opened in the streaming water-light of the barrier.
“Now!” Llesi breathed. “Now—follow it in!” She rushed forward.
There was one breathless, heart-stopping moment when the
rocks turned beneath their feel and Orelle, stumbling, nearly fell. The
darkness of the opened door was already beginning to mist over with
solidity when they reached it.
“Dangerous.” Llesi’s thought flashed through Miller’s brain,
lightning-like, far faster than it takes to express in words. “If we miss
the turn of the wall-substance we’ll be caught in the solid mass.
Hurry! Never mind making a noise. Hurry!”
It was like pushing through a thin jelly of darkness that gave way
readily enough but thickened perceptibly even as they moved. “Don’t
breathe!” Llesi warned them. “Hold your breath if you can—I think
you’ll be through in a moment.”
The substance of the wall was a stiff, scarcely yielding stuff by
the time they pushed free into clear air. They had made it with
nothing to spare. Orelle reached back to touch the surface with a
wondering hand as soon as she caught her breath, and the way they
had come was already a solid resilient surface that lost its resilience
as she pressed it and became hard unyielding wall again.
They stood in a steeply sloping corridor that echoed with the thin
voiceless music of the Power. Ahead of them the slowly spinning
stars were visible through cloudy grey moving rapidly up the ramp
away from them.
Silently they followed.
They were far down under the main floors of the castle. On their
left, as they climbed the steep ramp, the wall of flowing light moved
ceaselessly, tracing their shadows in the inner wall of the corridor.
“Somewhere there must be guards,” Orelle said.
“I’d feel better if we’d seen some before now,” Llesi told them
uneasily. “I have a feeling Brann may be more omniscient than we
know.”
The ramp came to a steep end and turned back upon itself in a
second long zig-zag rise. They toiled up in the wake of the cloudy
robot that carried the Power. Still no guards.
The ramp zig-zagged twice more and then there was a great
open area, like a spacious chimney, rising overhead. The ramp had
ended. Lightly, like the cloud it was, the robot left the ground.
Teleportation carried it out of sight with startling swiftness. From high
above the sound of voices drifted down the well, laughter, music.
Without a word Orelle put out her arm and clasped Miller’s hand.
A moment later the ground no longer pressed his feet. The light-wall
slid down past them like a Niagara of colored water.

The hall in which Brann held court was a vast domed circle. In
the center of it rose a dais—and over the dais a curtain of darkness
hung in straight columnar folds from the great height of the ceiling,
veiling the platform. On its steps a woman was sitting, a stringed
instrument on her knee. Rainbow hair swung forward about her
shoulders as she bent her head and swept a hand across the
strings. Wild, high music rang through the room.
Someone called, “Brann! Where is Brann?” and the woman
looked up, smiling. It was Tsi.
“He’ll be here. He’s coming. He expects guests,” she said and
looked straight across the room toward the far wall where, in an
alcove, the robot stood motionless, enshrouding the Power in a misty
cloud.
Behind the robot, huddled against the alcove wall, Miller felt
Orelle’s fingers tighten upon his. So long as the robot stood quiet,
they were hidden behind its foggy outlines. When it moved—
“She means us,” Orelle whispered. “I know Tsi. What shall we
do?”
“Wait,” Llesi counseled. “Listen.”
In the great room beyond, where Brann’s court of brilliantly robed
men and women lounged on divans that seemed cushioned with
substance as immaterial as mist, a discontented cry was beginning
to rise. Many mental voices blended in the clamor now.
“Brann! Call him up, Tsi, call him up! Tell him the robot’s here. We
want Brann again!”
Tsi swept the strings musically. “He’s still asleep, down below,”
she said. “I’m not sure if I dare wake him yet. Shall I try?”
“Go down and call him,” someone urged, petulance in the voice
that spoke. “We’ve waited too long already. Call him, Tsi!”
Tsi smiled. “His visitors must be here by now,” she said
maliciously. “Yes, I’ll go down and waken Brann.” She laid the harp
on the steps and rose.
At the same moment Miller felt a surge of force suddenly burst
into blinding violence in the center of his brain. For an instant he was
stunned by the power that seemed to pour tangibly forth from him
and through him. . . .
The robot that had screened them from view rose from the floor,
lightly as a cloud, drifted forward over the heads of the gaping
audience and turned suddenly incandescent just above the dais
where Tsi stood.
Miller knew it was Llesi’s doing, even before the quiet voice in his
brain said, “This is the best way, after all. Attack. You were right,
Miller. Now watch.”
The robot was pure flame now. With a detached part of his mind
Miller understood that it must have been deactivated once its
mission was completed, so that any mind which teleported it now
could do with it as it would. Llesi chose to destroy it in as spectacular
a manner as he could contrive.
Out of the blinding cloud of its dissolution the cube of the Power
fell, the singing halo in it turning with slow, indifferent steadiness.
The transparent block struck the steps a yard from where Tsi stood.
It struck—and crashed through, splitting the white marble from top to
floor. Tsi staggered.
The crash rang from the high vaults above, rebounding from arch
to arch in distant, diminishing echoes that came slowly back to the
watcher below, long after the dais had ceased to vibrate.
Tsi recovered her balance, turned on the shattered steps, looked
straight across the hall to the alcove where Miller and Orelle stood.
She was shaken but she had not lost her poise.
“Sister!” she said, “Welcome to Brann’s castle. Shall I call him to
greet you?”
From Orelle a strong steady thought went out, compelling and
quiet.
“Tsi, sister, you must do as you think best. Is it best for us that
Brann be called?”
The woman on the dais hesitated. Miller could see that the quiet
confidence in Orelle’s mental voice has shaken her a little. He knew
now what Orelle had meant when she said she could control Tsi.
It was a simple matter of sister speaking to sister with the voice of
authority, calling back to mind the precepts of conscience and
childhood training. Tsi was not, he thought, evil as Brann was evil.
She was weak, certainly—and perhaps the weakness would stand
them in good stead.
She said uncertainly, “Orelle, I think perhaps—” But the voices
from the audience around her, rising with sudden violence, drowned
out whatever it was she meant to say. Miller was reminded of Roman
audiences clamoring for blood in the arena.
“Brann, Brann!” the voices howled. “Waken Brann! Go call him up
to meet his guests! Brann, waken from your sleep! Brann, Brann, do
you hear us?”
Tsi hesitated a moment longer. Miller was aware of a desperate
stream of thought-waves pouring out from Orelle beside him but the
noise of the assembled people was too strong for her. She could not
get through to her sister. Tsi turned suddenly, putting both hands to
her face, and stumbled up the broken steps toward the dais.
The long curtains that hung a hundred feet or more from the
height of the ceiling trembled down all their dark length as she put
them aside and vanished into the big tent they made, hiding the
platform.
There was a moment’s profound silence.
Then Miller said quietly to Orelle, “Come on,” and, seizing her
hand, strode forward across the floor. He had no idea what he meant
to do but if he had come to attack then attack he must—not stand
waiting for Brann to make an entrance on his throne.

Heads turned avidly to watch their progress across the great


room. No one made a move to block their way, but eager eyes
watched every motion they made and searched their faces for
expression. This was the audience, Miller thought grimly, that would
have watched Brann’s terrible “experiments” upon him if he had not
escaped from the castle—with Tsi’s help. It was the audience, he
realized, that might yet watch, if he failed.
Llesi was silent in his brain, waiting.
They were almost at the steps when the curtains stirred as if a
breath of wind had blown through the hall. Tsi’s voice came weakly
from the hidden place, “Wait, Brann—you mustn’t—”
But drowning out the feeble protest another voice sounded clear.
Miller, hearing that thin, sweet, sneering pattern which was the
mental voice he had heard before, the voice of Brann, felt a chill
sliding down his spine and a tightening of all his muscles. It was a
hateful, a frightening voice, evoking a picture of a hateful man.
“Come out, Brann!” Miller said strongly. “Unless you’re afraid of
us—come out!”
Behind him in the hall two or three intrepid voices echoed the
invitation. “Come out Brann! Let us see you. You aren’t afraid, Brann
—come out!” He knew from that how high curiosity must run even in
Brann’s stronghold and he realized that not even here, then, had
Brann ever yet showed his face. It made him a little more confident.
If Brann had so much to hide, then, there must be weaknesses
behind that curtain upon which he could play.
He said, “Here’s the Power you wanted, Brann. We broke your
platform but here it is waiting. Do you dare come out and look at it?”
Brann said nothing. But his thin, sardonic laughter rang silently
through the hall.
Miller felt it rasping his nerves like something tangible. He said
roughly, “All right then—I’ll come and bring you out!” And he set his
foot firmly on the lowest step.
A breath of excitement and anticipation ran rippling through the
hall. Llesi was still silent. Orelle’s hand in Miller’s squeezed his
fingers reassuringly. He mounted the second step, reached out his
free hand for the curtain. . . .
There was a deep, wrenching sound of stone against stone, and
under his feet the steps lurched sickeningly. And then he was falling.
The walls spun. The floor tilted up to strike him a solid blow—that
did not touch him. For some firm, supporting mind closed its
protection around his body and he floated gently a dozen feet and
came to solid footing again, dazed but unhurt.
The marble block of steps lay upturned upon the floor.
Teleportation again, he realized. Brann had uprooted the steps he
had climbed to prevent him from reaching the curtain. And someone
—Llesi or Orelle—had reached out a mental beam to teleport him to
safety.
Brann’s cold clear laughter rang silently through the hall. He had
not yet spoken. He did not speak now but his derision was like vitriol
to the ears and the mind. Brann was waiting. . . . Somehow Miller
could sense that, as he waited, an eagerness and impatience went
out from him toward that block of transparence on the broken steps,
where the halo of the Power revolved on its singing axis.
Llesi realized it in the same instant and Miller felt in his brain the
beginnings of some plan take shape—too late. For now there was a
strange heaviness in the very air about him—a familiar
heaviness. . . . This was the weapon Brann had used on him once
before, turning the air itself to a crushing weight that had all but
smashed his ribs in upon the laboring lungs.
He felt his knees buckle under that sudden, overwhelming
pressure. The air screamed around him and the vast hanging
curtains of the dais billowed with a serpentine motion as displaced
air moved with hurricane suddenness through the great room.
Miller’s breath was stopped in his chest by that unbearable pressure.
His ears sang and the room swam redly before him. Brann’s
careless laughter was a distant ripple of sound.
Power from outside himself gathered in Miller’s brain, gathered
and spilled over in a wave like molten flame. He felt it gush out
toward the platform where Brann sat hidden. But he was blind and
deaf with the crushing weight of that suddenly ponderable air.
Even above his own deafness and the shriek of the unnatural
wind in the room he heard the scream of riven marble. And the
weight upon him lessened a little. He could see again. He could see
the great block of stone uprooted with jagged edges from the broken
floor at the foot of Brann’s dais.
It seemed to tear itself free, to leap into the air of its own volition
—to hurtle toward Brann’s curtains as if Brann’s castle itself had
suddenly turned upon him with great jagged stone fangs. In his brain
Miller could feel the tremendous, concentrated effort of Llesi’s
teleportation, balancing the marble weapon and guiding it on its
course.
The weight upon him ceased abruptly. The release was so
sudden that the congested blood drained from Miller’s brain and for
an instant the great room swam before him. In that moment of
faltering the hurtling marble fragment faltered too and Llesi and Miller
together struggled with the faintness of Miller’s overtaxed brain.

Brann seized the opening that brief hesitation gave him. He could
not stop the flying weapon but he could block it. . . . A broken
segment of the marble steps flew up in the path of the oncoming
boulder, grated against it, deflected its course.
The two struck together upon the dais steps and thundered down
them with a ponderous sort of deliberation, bounding from step to
step, their echoes rolling from the high ceiling. They went crashing
across the floor, ploughing into the divans where Brann’s court had
lain watching this unexpected sight.
The screams of the watchers as the great marble blocks rolled
down upon them added a frenzied accompaniment to the echoes of
thunder wakened by the stone itself. The room was a tumult of
sound re-echoing upon sound.
Miller felt a renewed outpouring of Llesi’s power move in his
brain. He saw a gigantic marble pillar across the room stagger
suddenly on its base, crack across, lean majestically outward and
fall. But it did not strike the floor. Instead it hurtled headlong, jagged
end first, toward the dais.
Above it the ceiling buckled. There was a terrible shriek of metal
upon stone as the vaulted roof gave way. But the falling debris, in
turn, did not strike the floor. Deflected in a rain of shattered marble, it
moved to intercept the flying pillar. Column and broken stone
together crashed to the ground at the very foot of Brann’s dais.
The great hall was full of the shrieks of the scattering court, the
cries of men caught beneath the falling ceiling, the uproar of echo
upon echo as Brann’s throne room collapsed in thunderous noise
upon its own floor.
When the thunder ceased all who could flee had vanished. Half
the ceiling lay in fragments upon the floor and Miller stood dizzily
looking up at the dais whose long curtains still billowed in the wind.
Brann was silent for a moment as if gathering his resources for
another try. And Llesi was whispering,
“My strength is failing, Miller. I can’t keep it up much longer. I’m
going to try one last thing. I’ve got to know what it is Brann’s hiding.
Help me if you can—and watch!”
For an instant there was silence. Then, from far overhead, a long
shudder began and rippled down the length of those vast hanging
curtains which shrouded Brann’s dais. Stone groaned deeply upon
stone in the ceiling.
From the hidden platform Brann shrieked a soundless, “No!” as
the block from which the curtains hung tore itself free of the vault
above and came crashing down to rebound from the shattering
pavement.
The curtains themselves fell far more slowly. Like smoke they
wavered in the air, collapsing softly, deliberately, parting to one side
and the other. . . .
Miller could see Brann trying to stop that fall. Invisibly the forces
of his mind seemed to claw at their drifting lengths. But there was
something wrong now in Brann’s mind. Even Miller could sense it.
A dissolution was taking place that the mind felt and shrank from.
Something worse than hysteria, more frightening than fear itself.
Llesi was suddenly intent and Orelle caught her breath.
Like smoke the last fragments of the curtains parted, lying to left
and right along the broken floor, far out, in long swaths of shadow.
On the platform stood Brann. . . .
The figure that had terrorized such a multitude for so long stood
swaying, clutching a black cloak about it as if to hide the shape of
the body beneath. The face was contorted into a terrible grimace of
anger and cold grinning hate. But the face itself was one they had all
seen before.
It was the face of Tsi.
Her eyes were closed. She did not look at them nor speak nor
move. And, Miller thought to himself, as Brann perhaps she had
never opened her eyes. As Brann perhaps that grimace of chill hate
always distorted her features. For it was clear to them all now that
Tsi was mad.
“Schizophrenia,” Miller thought automatically. “Split personality.”
But there was no answering thought from Llesi or from Orelle.
Stunned amazement held them both frozen.
Tsi turned her unseeing eyes to Orelle. In Brann’s thin, cold, high-
pitched voice-pattern she said, “Now you know. Now you’ve seen
Brann. But before I kill you both, tell me—Orelle, where is Tsi?”
Miller felt a cold shudder ripple over him.
CHAPTER VIII
The Consuming Fire
At the same moment he realized that Orelle and Llesi could not
help him against—Brann. Their thoughts came into his mind with a
stunned, incredulous tinge of astonishment, a blank bafflement that,
strangely, seemed to leave them helpless. And Miller thought he
knew why.
Orelle and Llesi and all their race had been conditioned to mental
perfection. Never before in their history, he sensed, had there been
any case of mental aberration. The race had been too perfect for
that. And now, faced with the pattern of schizophrenic split-
personality, they were utterly unable to comprehend its meaning. It
was too alien to them.
Insanity had never before existed in Orelle’s race.
Miller sent a frantic message to Llesi—inchoate confused
memory-pictures from his scant knowledge of psycho-therapy. But
Llesi did not understand. Instead he suddenly closed his mind. And,
beside Miller, Orelle, too, closed her mind against a concept so
shocking to this race that worshiped mental perfection that they
could not consciously face it.
The blind figure on the dais bent forward. “Orelle. . . .” it said.
So Brann did not know that the other half of his mind belonged to
Tsi. Naturally! Brann would not know that he was a half, an
incomplete split personality. Nor would Tsi know that Brann was part
of herself. What curious warp in the inherited genes had brought
about this cleavage Miller never knew, but he did not think about that
now.
He stepped forward.
“Brann!” he called.
“So you are back.” The thought came coldly into his mind. “Well,
the machine I tricked you into carrying failed to kill Llesi but I’ll
remedy that soon enough. As for you. . . .” Thin mental laughter
mocked Miller.
He felt sweat crawling down his forehead. “Wait,” he thought
urgently. “I can tell you where Tsi is.”
He sensed a hesitancy and then an urgent, straining question.
“Where? Where is she?”
“You are—”
Miller felt the mind on the dais close swiftly against the thought.
Brann would not let himself listen to the truth. He could not.
Brann thought. “Well? Answer me?”
Troubled, uncomprehending, Orelle and Llesi waited and
listened. And suddenly Miller knew the answer. He unbuckled the
wrist-watch from his arm. Orelle had returned it to him, the deadly
lightning machine removed. As a timepiece it was useless but habit
had made Miller keep the watch.
“Take this,” he said.
Brann—Tsi—waited.
Miller held it up. “It’s not dangerous any more. Can’t you tell
that?”
“A trick. You know nothing of what I wish to know. Why should I
waste time on any of you?”
“If you want to find Tsi,” Miller thought, “you must take this thing.
Unless you’re afraid to find her.”
The watch spun from his hand and shot glittering across the
room. It was in Brann’s hand.
Miller drew a long breath. “Turn it over. That’s it. Hold it up before
your face. Yes. Now . . . open your eyes.”
“My eyes will not open.”
“Open them!”
“They have never opened.”
Tension sang through the still air. Miller felt Orelle’s sudden
movement toward him.
“If you open your eyes you will find Tsi.”
That was the gap in the armor. That was the one thing that could
pierce Brann’s insane half-mind. The blind white eyelids quivered . . .
the long lashes lifted, slowly, slowly. . . .
Brann’s eyes looked into the polished steel back of the watch. In
that tiny mirror Brann’s eyes looked into—Tsi’s!
Tsi’s eyes—wide, horrified—stared into Brann’s!
There was no protection against the mental avalanche that
roared out from that rocking, screaming mind—the two minds—in the
single body of Tsi. For the first time Brann saw the girl he had
searched for since his strange birth. And for the first time Tsi saw her
own face twisted, distorted, into the grimace of chilly hatred that was
irrevocably stamped on Brann’s features.
But what Miller felt was—pity. It was the basic principle of mental
therapy—making the patient face his problem squarely. But no
ordinary human schizophrenic had ever thus had the curtains of his
brain ripped away with such sudden violence. The normal human
brain has automatic safeguards against such intrusion.
Tsi was of another race—a race mentally developed to a
tremendously high standard. She had been warped before birth
though the madness had remained latent for a long time—but her
mind was nevertheless powerful enough to be able to face the
shocking incredible truth.

She had never been evil, as was Brann—weak, yes, but


incapable of that cold cruelty her alter ego loved.
Face to face, for a thunderous, eternity-long instant, the two
stood—good and evil mated, monstrously wedded in one body and
one brain. The silence roared.
Then the hand that held the mirror dropped. The face of Tsi
swung round so that her mad, wild, terrified eyes met Miller’s—and
he read destruction there. The double mind looked out of those eyes
into his and for an instant it was as if both Tsi and Brann spoke to
him—as he had first heard them speaking when he woke in this
incredible world.
But then they had not known the truth. It had been a split mind
talking to itself, good and evil debating together and not guessing
they were housed in a single brain. Now they knew. At some point in
the past the evil inherent in Tsi had lost its battle with the good in her
—and pulled free of the control of her conscious mind. It had called
itself by a new name, given itself a masculine identity to disguise its
origin still further, grown so strong that not even Tsi could control it
any longer.
Brann was abhorrent to Tsi. And to Brann the knowledge that Tsi
was himself was a thing he could not face. The split mind, rocking on
its foundation, reached out into Miller’s mind with a mad destructive
violence.
“You brought ruin on me!” cried the double voice. “You wrecked
my castle and my life! You must die and all your kind with you!”
The eyes caught Miller’s in a drowning stare. He could not look
away, and the eyes were growing larger and larger, engulfing him in
darkness and in the darkness the madness of two minds swirled
terribly, carrying away his own sanity on those dreadful, reasonless
vortices. . . .
Miller could no longer see Orelle but he heard her moan, a soft
whimper of helpless terror. “I can’t—help you,” she was saying from
far away. “I can’t fight the two of them. Llesi—Llesi—where are you?”
For a moment there was no answer. The mad twin-mind buffeted
at Miller’s from both sides at once, pulling it asunder, spinning in two
opposite directions and straining him apart between them. No single
mind could withstand the doubled strength of that split brain dragging
him down to madness. . . .
And then, suddenly, he was not fighting alone. Out of the
darkness Llesi’s mind came swiftly, intangibly, yet with a strength as
if the man himself had set his shoulder against Miller’s, bracing him
against the whirlpool whose vortex led down to insanity.
Perhaps no other mind in existence could have stood against the
riven mind of Brann-Tsi. But in Miller’s brain too a double mind had
been housed—his own and Llesi’s. They had learned to work
together. And now they could fight. . . .
There was a voiceless scream of fury—Brann’s thin, high, sweet-
toned rage. And the buffeting redoubled from two sides at once. But
now there were two minds to meet the attack. Miller drew a deep
breath and set himself stubbornly against the whirling drag that was
pulling him down to darkness. He could feel the strong resistance of
Llesi’s mind, fighting beside his own, struggling hard against the
double pull.
For a timeless moment the vortex held them both. In that roaring
silence, while madness raved about them, neither side seemed able
to shake the others. Attacker and attacked stood matched so
perfectly that the balance might have held forever with the fury of the
split mind screaming its soundless cry in infinity.
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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like