Immediate download Problem Solving in Data Structures Algorithms Using C Programming Interview Guide 1st Edition Hemant Jain ebooks 2024
Immediate download Problem Solving in Data Structures Algorithms Using C Programming Interview Guide 1st Edition Hemant Jain ebooks 2024
com
https://textbookfull.com/product/problem-solving-in-data-
structures-algorithms-using-c-programming-interview-
guide-1st-edition-hemant-jain/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/problem-solving-in-data-structures-
algorithms-using-c-programming-interview-guide-first-edition-hemant-
jain/
textboxfull.com
https://textbookfull.com/product/problem-solving-in-data-structures-
algorithms-using-c-first-edition-jain/
textboxfull.com
https://textbookfull.com/product/data-structures-algorithms-in-go-1st-
edition-hemant-jain/
textboxfull.com
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
https://textbookfull.com/product/data-structures-with-c-
programming-2nd-edition-anil-kumar-yadav/
textboxfull.com
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
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.
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.
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.
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.
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.
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.
Example 1.1:
#include <iostream>
/*
Multiple line comments.
*/
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.
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.
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
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
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.
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.
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.
textbookfull.com