PGTRB 2025 - Cs 5 Units Sample Material
PGTRB 2025 - Cs 5 Units Sample Material
Topics Page. No
1. SYSTEM SOFTWARE 1
1.1 Different Types of Software 2
1.1.1 System Software 2
1.1.2. Application Software 4
1.2 Machine, Assembly and High-Level Languages 5
1.2.1 Low Level Language 5
1.2.1.1 Machine Language 6
1.2.1.2. Assembly Language 6
1.2.2 High Level Languages 7
1.3 Compilers and Interpreters 9
1.4 Loading, Linking and Relocation 13
1.5 Macros and Debuggers 15
1.5.1 Macros 15
1.5.2. Debuggers 16
Review Questions 18
2. BASICS OF OPERATING SYSTEM 21
2.1 Operating System Structure 21
2.1.1 Simple Structure 21
2.1.2 Layered Approach 22
2.1.3 Microkernels 23
2.1.4 Modules 24
2.1.5 Hybrid Systems 24
2.2 Operating-System Operations 25
2.3 Operating System Services 26
2.4 System Calls 29
2.5 Operating System Design and Implementation 32
2.5.1 Components of an Operating System 33
2.5.2. Implementation Details 36
2.6 System Boot 37
Review Questions 38
3. PROCESS MANAGEMENT 41
3.1 Process Scheduling and Operations 41
3.2 Inter-process Communication 43
3.2.1 Types of Inter-process Communication Mechanisms 43
3.2.2 IPC Mechanisms and Tools in Operating Systems 45
3.2.3 Synchronization in IPC 46
3.2.4 Advantages and Disadvantages of IPC 48
3.4 Communication in Client-Server Systems 47
3.5 Process Synchronization 50
3.5.1 Common Synchronization Problems 50
3.5.2 Mechanisms for Process Synchronization 51
3.5.3 Synchronization Algorithms 52
3.6 Critical Section Problem 53
3.6.1 Critical Section Problem in Operating System 54
3.6.2 Critical Section Requirements 54
3.6.3 Solutions to Critical Section Problems 55
3.7 Peterson’s Solutions 57
3.8 Semaphores 58
3.9 Synchronization 60
Review Questions 62
4. THREADS 65
Introduction 65
4.1 Multicore Programming 66
4.2 Multithreading Models 68
4.3 Thread Libraries 70
4.3.1 Pthreads 71
4.3.2 Windows Threads 73
4.3.3 Java Threads 74
4.4 Implicit Threading 75
4.5 Threading Issues 78
Review Questions 80
5. CPU SCHEDULING 82
5.1 Introduction 82
5.2 Scheduling Criteria 84
5.3 Scheduling Algorithms 85
5.3.1 First-Come, First-Served Scheduling 85
5.3.2 Shortest-Job-First Scheduling 86
5.3.3 Round-Robin Scheduling 88
5.3.4 Priority Scheduling 89
5.3.5 Multilevel Queue Scheduling 90
5.3.6 Multilevel Feedback Queue Scheduling 92
5.4 Thread Scheduling 94
5.5 Multi-Processor Scheduling 95
5.5.1 Approaches to Multiple-Processor Scheduling 95
5.5.2 Multicore Processors 96
5.5.3 Load Balancing 99
5.5.4 Processor Affinity 99
5.5.5 Heterogeneous Multiprocessing 100
5.6 Real-Time CPU Scheduling 101
5.6.1 Minimizing Latency 101
5.6.2 Priority-Based Scheduling 103
5.6.3 Rate-Monotonic Scheduling 104
5.6.4 Earliest-Deadline-First Scheduling 106
5.6.5 Proportional Share Scheduling 106
5.6.6 POSIX Real-Time Scheduling 106
Review Questions 107
6. DEADLOCKS 109
6.1 Introduction 109
6.2 Deadlock Characterization 109
6.2.1 Conditions for Deadlock 109
6.2.2 Resource-Allocation Graph 110
6.3 Methods for Handling Deadlocks 112
6.4 Deadlock Prevention 113
6.6 Deadlock Avoidance 113
6.6.1 Safe State 113
6.6.2 Resource-Allocation-Graph Algorithm 115
6.6.3 Banker’s Algorithm 117
6.7 Deadlock Detection 118
6.7.1 Single instance of each resource type 119
6.7.2 Several instances of a resource type 119
6.8 Recovery From Deadlock 120
6.8.1 Process And Thread Termination 120
6.8.2 Resource Preemption 121
Review Questions 122
7. MEMORY MANAGEMENT 124
7.1 Contiguous Memory Allocation 124
7.1.1. Memory Protection 124
7.1.2. Memory Allocation 125
7.1.3. Fragmentation: 127
7.2 Swapping 128
7.2.1 Standard Swapping 129
7.2.2 Swapping with Paging 129
7.2.3 Swapping on Mobile Systems 130
7.3 Paging 130
7.4 Segmentation 133
7.4.1 Concepts in Segmentation 133
7.4.2 How segmentation works? 134
7.5 Demand Paging 136
7.5.1 Why Demand Paging? 137
7.5.2 How does Demand Paging work? 137
7.5.3 Common terms in Demand Paging Operating System 137
7.5.4 Common Algorithms used for Demand Paging 138
7.6 Page Replacement 139
7.6.1 Page Replacement Algorithms 140
7.6.1.1. First In First Out (FIFO) 140
7.6.1.2. Optimal Page Replacement Algorithm 141
7.6.1.3 Least Recently Used (LRU) Page Replacement
142
Algorithm
7.6.1.4 Last In First Out (LIFO) Page Replacement Algorithm 144
7.6.1.5 Random Page Replacement in OS 145
7.7 Allocation of Frames 146
7.7.1 Minimum Number of Frames 146
7.7.2 Allocation Algorithms Equal Allocation 147
7.7.3 Global Vs. Local Allocation 147
7.8 Thrashing 148
7.8.1 Symptoms of Thrashing 149
7.8.2 Conditions for Thrashing 150
7.8.3 Thrashing Prevention through Working Set 150
7.9 Memory Mapped Files 151
7.9.1 Shared Memory in the Windows API 152
Review Questions 153
8. STORAGE MANAGEMENT 155
8.1. Mass Storage Structure 155
8.1.1 Magnetic Disk 156
8.1.2 Solid State Disks 161
8.1.3 Magnetic Tape 163
8.2 Disk Structures 164
8.3 Scheduling and Management 165
8.3.1 Disk Management 167
8.4 Raid Structure 169
Review Questions 172
9. FILE AND INPUT/OUTPUT SYSTEMS 174
9.1 Introduction 174
9.1.1 File Operations 175
9.2 Access Methods 176
9.3 Directory and Disk Structure 177
9.4 File System Mounting 181
9.5 File Sharing 183
9.6 File System Structure and Implementation 183
9.6.1 File System Implementation 185
9.7 Directory Implementation , Allocation Methods, and Free-Space
186
Management
9.7.1 File Allocation Methods 189
9.8 Efficiency and Performance in File Systems 190
9.9 Recovery in File Systems 191
9.10 I/O Hardware and Kernel I/O Subsystem 191
9.11 Transforming I/O requests to Hardware Operations 192
Review Questions 193
10. SECURITY 195
10.1 Introduction 195
10.2 Protection 196
10.2.1 Concepts in Protection 196
10.2.2 Types of Protection 198
10.2.3 Techniques for Protection 198
10.3 Access Matrix 199
10.4 Access Control 200
10.5 Revocation of Access Rights 201
10.6 Program Threats 202
10.7 System and Network Threats 206
10.7.1 Denial of Service (Dos) 208
10.7.2 Port Scanning 210
10.8 Cryptography as a Security Tool 212
10.9 User Authentication 216
10.10 Implementing Security Defenses 218
Review Questions 222
11. VIRTUAL MACHINES 225
11.1 Types of Virtual Machines 225
11.2 Virtual Machine Implementation 226
11.3 Virtualization 228
Review Questions 230
12. LINUX OPERATING SYSTEM 232
12.1 Introduction 232
12.2 Design Principles 233
12.3 Kernel Modules 234
12.4 Process Management 235
12.5 Scheduling 237
12.6 Memory Management 239
12.7 File Systems 243
12.8 Input and Output 244
12.9 Inter-Process Communication 245
12.10 Network Structure 246
Review Questions 247
13. WINDOWS OPERATING SYSTEM 249
13.1 Introduction 249
13.2 Design Principles 251
13.3 System Components 255
13. 4 Terminal Services and Fast User Switching 259
13.4.1. Terminal Services (Remote Desktop Services) 259
13.4.2. Fast User Switching (FUS) 260
13. 5 File System 262
13. 7 Networking 265
13.7.1 Networking Concepts in Windows OS 265
Review Questions 268
14. DISTRIBUTED SYSTEM 270
14.1 Introduction 270
14.2 Types of Network-Based Operating Systems 270
14.2.1 Network Operating Systems 271
14.2.2 Distributed Operating Systems 271
14.3 Network Structure 273
14.3.1 Components of Network Structure 273
14.3.2 Types of Network Topologies 274
14.3.3 Types of Networks Based on Structure 274
14.4 Communication Structure and Protocols 275
14.4.1 Communication Protocols in Network Structure 276
14.4.2 OSI Network Model 277
14.5 Robustness 281
14.5.1 Strategies for enhancing robustness in Distributed Systems 284
14.6 Design Issues 284
14.7 Distributed File System 286
Review Questions 287
POSSIBLE / IMPORTANT QUESTIONS 289
GLOSSARY 304
LAST MINUTE REVISION 308
TEACHER’S CARE ACADEMY, KANCHIPURAM
TNPSC-TRB- COMPUTER SCIENCE -TET COACHING CENTER
HEAD OFFICE: NO. 38/23, VAIGUNDA PERUMAL KOIL,
SANNATHI STREET, KANCHIPURAM – 1. CELL: 9566535080
B.Off 2: 65C, Thillai Ngr(West), 4th Cross St, Trichy – 620018
B.Off 3: Vijiyaraghavachariar Memorial Hall(Opp to Sundar Lodge), Salem
CHAPTER - 1
SYSTEM SOFTWARE
INTRODUCTION
In our day-to-day life we somehow come across with different types of software that
assist us in solving our tasks and help us to increase efficiency in our work. We find
software in various electronic gadgets like a Desktop, Laptop, Cellular Phone and
what not.
From operating system software that greets us when we switch on the computer
system to the web browser software that is used to explore the electronic content
through the internet or the games that we play on our computer to the step count
application software on our smart phone, are all instances of software.
In this technological world, we even come across various software development
trends that help our business to expand; we are surrounded by all this software
which helps to make our lives simpler.
By definition, Software is an assembly of data, programs, procedures, instructions,
and documentation that perform various predefined tasks on a computer system.
They enable users to interact with the computer by processing different type of
information.
Any software works only when it has an assistance of some computer hardware
technology. Both the entities need each other and neither one of them can be
influentially used on its own.
The incorporation of the hardware and the software gives control and flexibility to
modern-day computing systems. For example, without the help of our web browser
software, we will not be able to surf the Internet. Similarly, in the absence of an
operating system, no application can run on our computer.
Today there are ample of superior technologies and software accessible to us that
define the way we lead our lives and house our frequently changing needs. There
are non-ending numbers of software categorized on the basis of technology,
functionality, usage etc.
1.1 DIFFERENT TYPES OF SOFTWARE
Software is primarily classified into are two major types, namely System Software
and Application Software.
1.1.1 SYSTEM SOFTWARE
System software helps the user and the hardware device function and interacts with
each other. Basically, it is a type of software which is used to manage the
department of computer hardware to provide the very basic functionalities that are
required by the user. In simple words, we can say that system software works like
an inter-mediatory or a middle layer between the user and the hardware.
System software provides a necessary platform or an environment for the other
software to work in. Due to this reason system software plays an important role in
handling the overall computer system.
System software is not just limited to a desktop or a Laptop computer system. It has
a broad existence in various digital and electronic devices wherever there is a usage
of a computer processor. When a user turns on the computer, it is the system
software that gets initialized and gets loaded in the memory of the system.
The system software runs in the background and is not used by the end-users. This
is the reason why system software is also known as ‘low-level software’.
Following are the most common examples of system software:
1. Operating System (OS)
a. It is one of the popularly used System Software throughout the digital
arena. It is a collection of software that handles resources and provides
general services for the other applications that run over them.
b. Although each Operating System is different based on look and feel as
well as functionalities, most of them provide a Graphical User Interface
through which a user can manage the files and folders and perform other
tasks.
c. Every device, whether a desktop, laptop or mobile phone requires an
operating system to provide the basic functionality to it.
d. An Operating System essentially determines how a user interacts with the
system; therefore, many users prefer to use one specific OS for their
device. There are various types of operating system such as single user,
multiuser, embedded, real-time, distributed, mobile, etc. It is important to
consider the hardware specifications before choosing an operating
system.
e. Some examples of Operating systems software are Microsoft Windows,
Linux, Mac OS, Android, iOS, Ubuntu, UNIX, etc.
2. Device Drivers
a. It is a type of software that controls the hardware device which is attached
to the system. Hardware devices that need a driver to connect to a
system include displays, sound cards, printers, mouse, and hard disks.
b. Further, there are two types of device drivers: User Device Driver and
Kernel Device Drivers. Some examples of device drivers are VGA Drivers,
VGA Drivers, Virtual Device Drivers, BIOS Driver, Display Drivers,
Motherboard Drivers, Printer Drivers, ROM Drivers, Sound card Driver,
USB Drivers, USB Drivers, etc.
3. Firmware
a. It is the permanent software that is embedded into a read-only memory. It
is a set of instructions permanently stored on a hardware device. It
provides essential information regarding how the device interacts with
other hardware.
b. Firmware can be considered as ‘semi-permanent’ as it remains
permanent unless it is updated using a firmware updater.
c. Some examples of firmware are: BIOS, Computer Peripherals, Consumer
Applications, Embedded Systems, UEFI, etc.
4. Programming Language Translators
a. These are mediator programs on which software programs rely to
translate high-level language code to simpler machine level code.
b. Besides simplifying the code, the translators have the capability to Assign
data storage, enlist source code as well as program details, Offer
diagnostic reports, Rectify system errors during the runtime.
c. Examples of Programming Language Translators are Interpreter,
Compiler and Assemblers.
5. Utility
a. This software is designed to aid in analyzing, optimizing, configuring and
maintaining a computer system. It supports the computer infrastructure.
b. This software focuses on how an OS functions and then accordingly it
decides its trajectory to smoothen the functioning of the system.
c. Software like antiviruses, disk cleanup & management tools, compression
tools, defragmenters, etc., they are all utility tools.
1.1.2. APPLICATION SOFTWARE
Also known as end-user programs or productivity programs are software that helps
the user in completing various tasks. In contrast to system software, this software is
specific in their functionality or tasks used by the end-user. This software is placed
above the system software.
Application Software or simply apps can also be referred to as non-essential
software as their requirement is highly subjective and their absence does not affect
the functioning of the system.
For example, such as a text editor, online train or a flight booking application, online
banking web-based application, a billing application, high end graphics designing
application, accounting software, any type of calculator application or even
standalone as well as online games software, the various applications that we use in
our cellular phones are also the examples of Application Software.
There are various types of application software:
1. Word Processors: These applications are widely used to create the
documentation. It also helps in storage, formatting, and printing of these
documents. Some examples of word processors are Abiword, apple iWork-
Pages, Corel WordPerfect, Google Docs, MS Word etc.
2. Database Software: This software is used to create and manage a database. It
is also known as the Database Management System or DBMS. They help with
the organization of data. Some examples of DBMS are Clipper, dBase,
FileMaker, FoxPro, MySQL etc.
3. Multimedia Software: It is the software that can play, create, or record images,
audio or video files. They are used for video editing, animation, graphics, and
image editing; some examples of Multimedia Software are Adobe Photoshop,
Inkscape, Media Monkey, Picasa, VLC Media Player, Windows Media Player,
Windows Movie Maker etc.
4. Education and Reference Software: These types of software are specifically
designed to facilitate learning on a particular subject. There are various kinds of
tutorial software that fall under this category. They are also termed as academic
software. Some examples are Delta Drawing, GCompris, Jumpstart titles, KidPix,
MindPlay, Tux Paint etc.
5. Graphics Software: As the name suggests, Graphics Software has been
devised to work with graphics as it helps the user to edit or make changes in
visual data or images. It comprises of picture editors and illustration software.
Some examples are Adobe Photoshop, Autodesk Maya, Blender, CorelDRAW,
GIMP, Modo, PaintShop Pro etc.
6. Web Browsers: These applications are used to browse the internet. They help
the user in locating and retrieving data across the web. Some examples of web
browsers are Google Chrome, Internet Explorer, Microsoft Edge, Mozilla Firefox,
Opera, Safari, UC Browser etc.
1.2 MACHINE, ASSEMBLY AND HIGH-LEVEL LANGUAGES
A language is the main medium of communicating between the Computer systems
and the most common are the programming languages. A language consists of all
the instructions to make a request to the system for processing a task.
Some of the languages like programming language which is a set of codes or
instructions used for communicating the machine.
Machine code is also considered as a computer language that can be used for
programming. And also HTML which is a computer language or a markup language
but not a programming language.
Similarly there are different types of languages developed for different types of work
to be performed by communicating with the machine. But all the languages that are
now available are categorized into two basic types of languages including:
o Low-level language and
o High level language
Low level languages are programmer- High level languages are human
2.
friendly friendly.
The programs in low level language The programs in a high level language
6. are not portable from one computer to are portable, so we can use them on
another. any computer.
Usage of low level language is less in We use high level language in today’s
7.
today’s technologies. technologies.
object code and saves it as a file before executing it. Conversely, an interpreter
converts and executes source code line by line without saving it and points out
errors along the way.
Compiled languages include C, C++, COBOL, and FORTRAN. Python utilizes an
language into assembly language, and others directly convert it to machine code.
This conversion of source code into machine code is called compilation. Popular
computer languages that use compilers include C, C++, COBOL, and FORTRAN,
among others.
How does a compiler work?
The operation of a compiler can be categorized as follows:
Source code creation: The source code is a piece of code composed in a text
editor, and the file extension for the source code is ‘.c,’ if you are using a compiler
with the C programming language as an example.
Pre-processing: This source code is initially transmitted to the pre-processor,
which expands it. The enlarged code will be provided to the compiler after
expansion.
Compiling: The code expanded by the pre-processor is passed to the compiler,
which converts it into assembly code.
Conversion into object code by an assembler: Using an assembler, the
assembly code is transformed into object code. The object file created by an
assembler has the same name as the source file.
Linking: When a program occasionally references functions specified in other
files, the linker serves a crucial role. In the compiler workflow, the primary function
of a linker is to connect the object code of coding library data alongside the object
code of a program.
Execution: The executable file is the final product of the linker.
Pros and cons of a compiler
A compiler offers the following advantages:
It operates quicker than the interpreter because the source code has already been
compiled and the executable file has been generated.
Client does not need to install a compiler, interpreter, or third-party program to run
the executable file of our shared source code.
On all of your clients’ and any other system, executable files generated by the
compiler can be launched without needing the source code. This renders your
program hack-proof, protected, and confidential.
The machine code of an executable file generated by a compiler is frequently a
well-optimized, native machine command for the intended machine, resulting in
accelerated execution.
However, compilers do have a few drawbacks:
Since its code is optimized for the system on which it was executed, it could
trigger system compatibility issues.
Compilers must generate a new file, which consumes additional memory.
After perusing the entire code, it returns all available errors at once, making it
harder to locate and correct them.
Unlike an interpreter, we cannot run the source code straight away; we must
additionally launch the executable file.
What Is an Interpreter?
The software that executes the line-by-line conversion of high-level instructions to
programs, the source code is always required for processing. Consequently, they
tend to execute more slowly than compiled programs. Among the most prominent
programming languages, Python utilizes an interpreter. JavaScript, Perl, and BASIC
are instances of other popular interpreter-led programming languages.
How does an interpreter work?
The operation of an interpreter can be broken down as follows:
Source code creation: This step of the functionality is the same as in the case of
a compiler. During runtime, however, the interpreter transforms the source code
one line at a time.
Direct interpretation: An interpreter meticulously translates a high-level language
program into machine-level language.
Source code editing: The interpreter permits program assessment and
modification throughout the execution in a side-by-side window.
Execution: Compared to the compiler, program execution is moderately sluggish
since all the linking is done at runtime without a separate linker.
Advantages of interpreters:
Since it scans the code line by line and sends the error notice straight away,
debugging is simpler.
Those with access to the source code can easily rectify or alter the code if
necessary.
In interpreted languages, the source code can be directly shared and executed on
any machine without device incompatibility problems.
Interpreters do not create new independent files. As a result, it does not consume
additional memory.
The source code is executed without any additional steps; it is run spontaneously.
Disadvantages of interpreters:
If code execution is interrupted at any point, interpreters restart from the beginning
every time the code is executed.
The interpreter is typically more sluggish than the compiler as it scans, analyses,
and transforms each line of code individually.
A client or anyone with access to the shared source code will need an interpreter
installed on their system to execute the code.
To pass on an interpreted program with others, one must share unsecured and
non-private source code.
Compiler vs. Interpreter: Key Differences
The basic differences between compilers and interpreters are listed below.
Feature Compiler Interpreter
Translation Translates the entire source Translates the source code line-
code into machine code at once. by-line during execution.
Execution The compiled program is Executes the program directly,
executed after the entire line by line.
translation is done.
Speed of Faster, as the program is Slower, as translation and
Execution already translated into machine execution occur simultaneously.
code.
Error Detection Errors are detected after the Errors are detected line-by-line,
entire code is compiled, so and execution stops at the first
debugging is done after error.
compilation.
Output Produces an independent No separate output file; code is
executable file (e.g., .exe, executed on the fly.
binary).
Portability The compiled machine code is More portable since the same
specific to a particular platform source code can run anywhere
(e.g., Windows, macOS, Linux). the interpreter is available.
Memory Usage Requires additional memory for Typically uses less memory
storing the executable. since it doesn’t produce a
separate executable.
Examples C, C++, Java (compiles to Python, JavaScript, Ruby, PHP,
bytecode), Swift, Rust. MATLAB.
1.4 Loading, Linking and Relocation (UGC-NET-DEC-2013)
The loader loads the program into the main memory for execution of that program. It
loads machine instruction and data of related programs and subroutines into the
main memory, this process is known as loading. The loader performs loading;
hence, the assembler must provide the loader with the object program.
Functions of Loader:
1. Allocation: It allocates memory for the program in the main memory.
2. Linking: It combines two or more separate object programs or modules and
supplies necessary information.
3. Relocation: It modifies the object program so that it can be loaded at an address
different from the location.
4. Loading: It brings the object program into the main memory for execution.
Loader is utility program which takes object code as input prepares it for execution
and loads the executable code into the memory. Thus loader is actually responsible
for initiating the executions process.
1. Loading
Loading refers to the process of bringing the executable program or code into
memory so that it can be executed by the computer's processor. The loader, a part
of the operating system, handles this process.
It prepares the program to run by placing it into memory, assigning it an appropriate
address space, and ensuring that the program's code and data are available to the
CPU.
Steps in Loading:
o Load the executable into memory: The operating system loads the
compiled machine code (executable) from disk into RAM.
o Allocate space for data and code: The code section and data section
(such as variables) of the program are assigned specific areas in memory.
o Set up the execution context: The loader prepares the environment for
execution, including setting up stacks, heaps, and registers.
UNIT-VI DATA STRUCTURES & ALGORITHMS
CHAPTER 7 : TREES
7.1 Introduction 65
CHAPTER 8 : FOREST
8.1 What is Tree and Forest 69
8.1.2. Forest 70
2
8.3.1. Cutting- Down Method 71
8.3.2. Building - up Method 72
CHAPTER 9 : BINARY TREE
9.1 Introduction 74
9.1.1. Tree vs Binary Tree 75
4
16.8 Types of Hash Functions 186
16.8.1. Division Method 186
16.8.2.Mid Square Method 186
16.8.3. Folding Method 187
16.8.4. Multiplication Method 187
16.9 What is a Hash Collision 189
16.9.1. Collision Resolution Techniques in Data Structures 189
16.9.1.1. Open hashing/separate chaining/closed addressing 189
16.9.1.2. Closed hashing (open addressing) 189
16.10 Importance of Hashing 192
16.11 Limitations of Hashing 192
CHAPTER 17 : PERFORMANCE ANALYSIS OF AN ALGORITHM
17.1 Introduction 193
17.2 Time Complexity 194
17.2.1. Components of Time Complexity 194
17.3 Space Complexity 194
17.3.1. Components of Space Complexity 195
17.4 How to Calculate Worst Case Time Complexity of Bubble Sort 196
CHAPTER 18 : ASYMPTOTIC NOTATION
18.1 Introduction 199
18.2 Big Oh Notation Ο 200
18.3 Omega Notation, Ω 200
18.4 Theta Notation, θ 200
CHAPTER 19 : RECURRENCE RELATIONS.
19.1 Recurrences 202
19.2. Substitution Method (Back Substitution Method) 203
19.3 Recurrence Tree Method 206
19.4 Master Method 208
19.5 Sorting Algorithms 209
19.5.1. Bubble Sort 210
CHAPTER 20 : DESIGN TECHNIQUES
20.1 Divide and Conquer 212
20.1.1. Introduction 212
20.1.2. Relational Formula 213
20.1.3. Stopping Condition 213
20.1.4. Binary Search 214
CHAPTER 21 : DYNAMIC PROGRAMMING
21.1 Introduction 216
21.2 Characteristics of Dynamic Programming 216
21.3 Elements of Dynamic Programming 217
5
21.4 Components of Dynamic Programming 217
21.5 Development of Dynamic Programming Algorithm 218
21.6 Applications of Dynamic Programming 218
21.6.1. Optimal Binary Search Tree 218
21.6.2. Longest Common Subsequence 219
CHAPTER 22 : GREEDY APPROACH
22.1 History of Greedy Algorithms 223
22.2 Introduction 223
22.3 Huffman Code 224
22.3.1.Introduction 224
CHAPTER 23 : BACKTRACKING AND BRANCH AND BOUND
23.1 Introduction 230
23.2 Backtracking 230
23.3 N-Queen Problem 231
23.4 Hamiltonian Circuit Problem 232
23.5 Subset-Sum Problem 233
23.6 Assignment Problem 234
23.7 Knapsack Problem 235
23.8 Traveling Salesman Problem 237
CHAPTER 24 : GRAPH ALGORITHMS
24.1 Graph 239
24.1. 1.Introduction 239
24.1.2. Types of Graph 240
24.1.3. Graph Terminologies 241
24.1.4. Representation Of Graphs 244
24.1.5. Operations On Graphs 247
CHAPTER 25: BFS (BREADTH FIRST SEARCH) 253
CHAPTER 26: DFS (DEPTH FIRST SEARCH) 256
26.1. Application of Graph Structures 261
CHAPTER 27:SHORTEST PATH PROBLEM
27.1 Warshall’s Algorithm 264
27.2 Floyd’s Algorithm 265
27.3 Dijkstra’s Algorithm 266
CHAPTER 28: MAXIMUM FLOW
28.1 Introduction 270
28.2 Maximum Flow Problem 271
28.3 Maximum Flow Problem Using Ford Fulkerson Method 272
CHAPTER 29: MINIMUM SPANNING TREE
29.1 Introduction 275
29.2 Kruskal’s algorithm 275
6
29.3 Prim’s algorithm 277
CHAPTER 30: ADVANCED ALGORITHMS: PARALLEL ALGORITHMS FOR SORTING,
SEARCHING, AND MERGING
30.1 Parallel Sorting Algorithms 281
30.1.1.Parallel Merge Sort 282
30.1.2.Bitonic Sort Algorithm 283
30.1.3. Sample Sort 285
30.2 Parallel Searching Algorithms 287
30.2.1.Parallel Binary Search 287
30.2.2. Parallel Hashing 290
CHAPTER 31: APPROXIMATION ALGORITHMS
31.1 Introduction 297
31.2 Key Characteristics 297
31.2.1. Vertex Cover Problem 298
31.2.2. Travelling Salesman Problem (TSP) 298
31.2.3. Knapsack Problem 301
CHAPTER 32: RANDOMIZED ALGORITHMS
32.1 Introduction 303
32.2 Characteristics of Randomized Algorithms 304
32.3 Generation of Random Numbers 304
32.4 Design Principles of Randomized Algorithms 304
7
Page 1 of 333
SYLLABUS
Data Structures: Abstract data types, Arrays and their Applications; Sparse Matrix, Stacks,
Queues, Priority Queues, Linked Lists,
Trees and Graph: Trees, Forest, Binary Tree, Threaded Binary Tree, Binary Search Tree, AVL
Tree, B Tree, B+ Tree, B* Tree, Graphs, Sorting and Searching Algorithms; Hashing.
Graph Algorithms: Breadth-First Search, Depth-First Search, Shortest Paths, Maximum Flow,
BOOKS TO STUDY:
1) Classic Data Structures - D.Samanta
2) Data Structures made simple - Sathish Jain, Shashi Singh.
MIT Press.
Extra Bytes:
1) Which one of the following is a nonlinear data structures? (PGTRB 2019)
(A) Arrays (B) Sets
(C) Queue (D) Linked list
Answer: B - Sets
1. ARRAY AND THEIR APPLICATIONS
• jjAn array is a collection of items stored at contiguous memory locations.
• The idea is to store multiple items of the same type together.
• This makes it easier to calculate the position of each element by simply adding an offset
to a base value, i.e., the memory location of the first element of the array (generally
denoted by the name of the array).
• Array data structure is typically used to implement hash table (UGC NET 2023)
1.1. ARRAYS TERMINOLOGY:
Size:
Number of elements in an array is called the size of the array. Also called as length or
dimension.
Type:
Type of an away represents the kind of data type. Ex: int, string
Base:
Base of an array is address of memory location where the first element in the array is
located.
Range of index:
Indices of array elements any charge can be referenced by subscript like Ai or A[i], this
subscript is known as index. Index is always as integer value. Every element is
identified by a subscripted or indexed variable
Ex:
Int A[100]; The range of index is from 0 to 9
A:Array[-5….19] of integer: The Points of the rage is -5,-4,-3,….18,19.
Here L is the Lower Bound.
If the range of index varies from L…U then the size of the away can be calculated as
Size(A)=U-L+1.
Word:
It denotes the size of an element. In memory location computer can store an element of
word size w. This word size varies from machine to machine such as 1 byte to 8 bytes.
1.2. OPERATIONS ON ARRAY
The common operations can be performed on an array are
Traversing-processing each element in the array.
Sorting -Organizing the elements in some order.
Searching -Finding the location of an element with a given value.
Insertion - Adding a new element.
Deletion -Removing an element.
Merging -Combining two arrays into a single array.
Although searching, and traversal of an array is an easy job, insertion and deletion is
time consuming. The elements need to be shifted down before insertion and shifted up
after deletion.
1. Traversing:
This operation is used visiting all elements in an array.
Example: Array ‘a’ contains the following elements:
5 3 4 8 7
3. End while
4. Stop
Here process ( ) is an procedure which when called for an element can perform an action
2. Sorting:
This operation if performed on an array will sort it in a specified order. The algorithm is
used to store the elements of an integer array in ascending order or descending order.
Example:
Algorithm steps:
1) Read the array elements.
2) Set the first position by comparing the first position of the array element with
other array element. If the value is smaller than the first position element, then
swap the elements.
3) Set the second position by comparing the elements. If the value is smaller than
the second position element, then swap the elements.
4) Set the other positions likewise.
Input: An array with integer data
Output: An array with sorted element in an order according to ORDER ( )
Steps:
1. i= U
2. While i>= L do
1. j=L // start comparing from first
2. While j< i do
1. If ORDER (A[j, A[j+1]) = FALSE // if A[j] and A[j+1] are not
in order
1. Swap (A[j], A[j+1]) // Interchange the elements
2. Endif
3. j=j+1 // Go to next statement
3. Endwhile
4. i=i-1
3. Endwhile
4. Stop
Here order ( ) is a procedure to test whether two elements are in order and SWAP ( ) is a
procedure to interchange the elements between two consecutive locations.
Element to search: 8
The given element is present in the position: 4
Algorithm steps:
1) Read the element to search.
2) Compare the element to the array elements.
3) If it matches then, display the position of the array.
4) Otherwise compare the entire array.
5) If match not found display the message “search is unsuccessful, key is not in the
array “
Algorithm: Search_array(key)
Input: Key is the element to be searched
Output: Index of key in A or a message on failure
Steps:
1. i=L, found=0, location=0 // found=0 indicates search is not finished and
unsuccessful
2. While (i<=U) and (found =0) do
1. if compare(A[i], key) = true then
1. Found=1
2. Location =i
2. Else
1. i=i+1
3. End if
3. End while
4. If found=0 then
1. Print “search is unsuccessful; key is not in the array “
5. Else
1. Print “search is successful: key is in the array at location “, location
6. End if
7. Return (location)
8. Stop--
4. Insertion:
This operation is used to insert an element into an array provided that the array is not
full.
Example:
Array
4 5 6 8 9
Insert -2 at position: 3
4 5 -2 6 8 9 After insertion
2. Else
1. i = U
2. While i> location do
1. A[i+1]=A[i]
2. i = i-1
3. End while
4. A[location] =key
5. U=U+1
3. End if
4. Stop
5. Deletion:
This operation is used to delete a particular element from an array. The element will be
deleted by overwriting it with its subsequent element and this subsequent element then is to be
deleted.
Example: Delete the element in the position: 3
Before deletion:
4 5 6 8 9
After deletion:
4 5 8 9 0 0
Algorithm steps:
1) Read the position to delete.
2) Shift the numbers placed after the position, where the number is to be
deleted.
3) Leave the last position blank.
Algorithm: delete (key)
Input: key is the element to be deleted.
Output: slimed array without key
Steps:
1. i = search_array (a, key)
2. if i=0 then
1. print “key is not found, no deletion”
2. Exit
3. Else
1. While i< U do
www.tcaexamguide.com (95665 35080; 9786269980; 76399 67359; 93602 68118 )
Page 9 of 333
1. A[i] = A[i+1]
2. i = i+1
3. End while
4. End if
5. A[U] = NULL
6. U=U-1
7. Stop
6. Merging:
Merging is an important operation when we need to compact the elements from two
different arrays into a single array.
Rules:
1) Copy all the elements of first array into a new array (third array)
2) Copy the second array into the third array after the position, at which the last
elements of the first array copied.
Types
Merging can be done in two ways:
Merging without sorting.
Merging with sorting.
1 1
3 3
7 7
2
4
2 8
4
8
Fig: merging of A1 and A2 to A
Algorithm: merge (A1, A2: A)
Input: Two arrays A1 [L1…U1], A2 [l2…U2]
Output: Result array A [L…U], where L=L1 and U=U1+(U2-L2+1) when A1 is append after
A2
Steps:
1. i1=L1, i2=L2; // initialization of variables
2. L=L1, U=U1+U2 –L2 +1 // initialization of lower and upper bounds
of an array
www.tcaexamguide.com (95665 35080; 9786269980; 76399 67359; 93602 68118 )
Page 10 of 333
3. i=L
4. Allocate memory for a[L…U]
5. while i1<U do // to copy array A1 into the first part of A
1. A[i] = A1[i1]
2. i=i+1, i1=i1+1
6. End while
7. While i2<=U2 do // To copy the array A2 into last part of A
1. A[i] = A2[i2]
2. i=i+1, i2=i2+1
8. End while
9. Stop
COMPLEXITY ANALYSIS OF OPERATIONS ON ARRAYS
Time Complexity
2.Two-dimensional Array
In types of arrays, a two dimensional array is a tabular representation of data where
elements are stored in rows and columns.
3.Three-dimensional Array
In types of arrays, a three-dimensional array is an extension to the two dimensional array
with addition of depth.
It can be seen as a cube that has rows, columns and depth as third dimension. To access
any element in a three-dimensional array three subscripts are required for position of
element in a specific row, column and depth.
The first index is for depth (dimension or layer), second is for row index and third is for
column. In the example shown the index values (2,0,3) is used to access element 24.
• Flexibility: Arrays are used to implement other data structures like stacks, queues, trees,
graphs, etc.
• Easy to remember: Arrays represent multiple data items of the same type using a single
name. Therefore, it’s easier to remember an array name than remembering the names of
several variables.
DISADVANTAGES
• Fixed-size: The size of an array is fixed at the time of its creation, which means that once
the array is created, its size cannot be changed. This can be a limitation in situations where
the size of the data is not known in advance.
• Memory wastage: There will be a wastage of memory if we store less number of elements
than the declared size because there is static memory allocation in arrays.
• Inefficient insertion and deletion: Arrays store data in contiguous memory locations,
which makes deletion and insertion very difficult to implement. All the elements after
insertion or deletion must be shifted to accommodate the new element or fill in the gap.
This can be a time-consuming process, especially for large arrays.
• Homogeneous data: Arrays can only store elements of the same data type, which can be
a limitation in situations where the user needs to store data of different types.
• No built-in support for dynamic resizing: While some programming languages provide
built-in support for dynamic resizing of arrays, many do not. In those cases, the developer
may have to implement their own resizing logic, which can be complex and error-prone.
EXCERICE 1:
1) What is Data Structure?
a) Address of the variable c) The memory representation of data
b) Subset of all variables d) The type of the variable
2) Which of the following is a collection of heterogeneous elements?
a) Array c) Stack
b) Structure d) Queue
3) __________is a linear data structure
a) Tree c) Graph
b) Array d) None of these.
4) The Smallest element of an array index is __________
a) Smallest Bound c) First Bound
b) Lower Bound d) Higher Bound
2.SPARSE MATRIX
2.1. WHAT IS A MATRIX?
A matrix can be defined as a two-dimensional array having 'm' rows and 'n' columns. A matrix
with m rows and n columns is called m × n matrix. It is a set of numbers that are arranged in
the horizontal or vertical lines of entries.
For example:
Row: It is the index of a row where a non-zero element is located in the matrix.
Column: It is the index of the column where a non-zero element is located in the matrix.
Value: It is the value of the non-zero element that is located at the index (row, column).
Example
Let's understand the array representation of sparse matrix with the help of the example given
below
Consider the sparse matrix
In the above figure, we can observe a 5x4 sparse matrix containing 7 non-zero elements and
13 zero elements. The above matrix occupies 5x4 = 20 memory space. Increasing the size of
matrix will increase the wastage space.
The tabular representation of the above matrix is given below
In the above structure, first column represents the rows, the second column represents the
columns, and the third column represents the non-zero value. The first row of the table
represents the triplets. The first triplet represents that the value 4 is stored at 0th row and 1st
column. Similarly, the second triplet represents that the value 5 is stored at the 0th row and 3rd
column. In a similar manner, all triplets represent the stored location of the non-zero elements
in the matrix.
The size of the table depends upon the total number of non-zero elements in the given sparse
matrix. Above table occupies 8x3 = 24 memory space which is more than the space occupied
by the sparse matrix. So, what's the benefit of using the sparse matrix? Consider the case if the
matrix is 8*8 and there are only 8 non-zero elements in the matrix, then the space occupied by
the sparse matrix would be 8*8 = 64, whereas the space occupied by the table represented
using triplets would be 8*3 = 24.
2.3.2. LINKED LIST REPRESENTATION OF THE SPARSE MATRIX
In a linked list representation, the linked list data structure is used to represent the sparse
matrix. The advantage of using a linked list to represent the sparse matrix is that the complexity
of inserting or deleting a node in a linked list is lesser than the array.
Unlike the array representation, a node in the linked list representation consists of four fields.
The four fields of the linked list are given as follows -
Row: It represents the index of the row where the non-zero element is located.
Column: It represents the index of the column where the non-zero element is located.
Value: It is the value of the non-zero element that is located at the index (row, column).
Next node: It stores the address of the next node.
The node structure of the linked list representation of the sparse matrix is shown in the below
image
Example
Let's understand the linked list representation of sparse matrix with the help of the example
given below
Consider the sparse matrix
In the above figure, we can observe a 4x4 sparse matrix containing 5 non-zero elements and
11 zero elements. Above matrix occupies 4x4 = 16 memory space. Increasing the size of
matrix will increase the wastage space.
The linked list representation of the above matrix is given below -
In the above figure, the sparse matrix is represented in the linked list form. In the node, the
first field represents the index of the row, the second field represents the index of the column,
the third field represents the value, and the fourth field contains the address of the next node.
In the above figure, the first field of the first node of the linked list contains 0, which means
0th row, the second field contains 2, which means 2nd column, and the third field contains 1
that is the non-zero element. So, the first node represents that element 1 is stored at the 0th row-
2nd column in the given sparse matrix. In a similar manner, all of the nodes represent the non-
zero elements of the sparse matrix.
EXCERICE 2:
1) What is a sparse matrix?
a) A matrix with a large number of non-zero elements
b) A matrix with a large number of zero elements
c) A matrix with only one row
d) A matrix with only one column
2) Which of the following is a common representation format for sparse matrices?
a) Dense matrix c) Binary tree
b) Coordinate List (COO) d) Linked list
3) Which data structure is commonly used to store non-zero elements in a sparse
matrix?
a) List of Lists (LIL) c) Binary tree
b) Array d) Stack
4) Which of the following operations is typically more efficient on a sparse matrix
compared to a dense matrix?
a) Matrix addition c) Matrix transposition
b) Matrix multiplication d) Matrix inversion
5) Which of the following statements about converting a dense matrix to a sparse matrix
is true?
a) The resulting sparse matrix will have more non-zero elements than the dense matrix.
b) The process involves identifying and storing only the non-zero elements.
c) The resulting sparse matrix will have a larger memory footprint than the dense matrix.
d) The process requires converting all elements to zero.
6) In which application area are sparse matrices commonly used?
a) Image processing c) Real-time gaming
b) Cryptography d) Audio processing
7) Which data structure provides fast access to individual elements in a sparse matrix?
a) Array c) Dictionary
b) Linked List d) Stack
8) Which application domain extensively uses sparse matrices for computations?
a) Image processing c) Natural language processing
b) Web development d) Mobile app development
9) What is the time complexity of converting a sparse matrix to triples form?
a) O (n) c) O (m + n)
b) O (n log n) d) O (m * n)
10) In triples form representation of a sparse matrix, what information is stored for each
non-zero element?
a) Row index, column index, and value
b) Row index, column index, and matrix dimension
c) Element position and value
d) Element position and matrix dimension
3. STACK
3.1. INTRODUCTION
• Stack is a linear data structure and which items are added or from which items can be
deleted at one end only. This end is called as top.
• Stack follows the LIFO policy because the element which is added last will be removed
first.
• Ex:
– Printer tray
– Shipment in a cargo.
– Order supply in a restaurant.
3.1.1. DEFINITION
• A stack is an ordered collection of homogeneous data element where the insertion &
deletion operation take place at one end only. (PGTRB 2022)
• The insertion and deletion operations in case of stack are specially termed as PUSH and
POP.
• Push() Insert new elements into the Stack
• Pop() Remove an element from the stack
• Where the operations are performed is known as TOP of the stack.
• An element in a stack is termed as ITEM.
• The maximum number of elements that a stack can accommodate is termed as SIZE.
S.No CONTENT Page No.
1.5 Signal 13
1.6 Noise 21
1.7.4. Frequency 43
1.12 Error 75
1.12.1. Types Of Errors In Computer Network 76
UNIT-5
DATA COMMUNICATION AND COMPUTER NETWORKS
SYLLABUS
CHAPTER 1
DATA COMMUNICATION
1.1 COMPONENTS OF DATA COMMUNICATION SYSTEM
Sending or Receiving information, such as speaking, writing, telephone lines ,
computers or using some other medium is communication.
The communication system basically deals with the transmission of information
from one point to another using the well-defined steps which are carried out in
sequential manner. The system for data transmission makes use of the sender
and destination address, In this other so many elements are also there that allows
it to transfer data from one set of point to another set of point after dividing
the elements of communication system in groups and these interface elements
acts as the main component for data communication.
4. Communication Channel/Medium:
The communication channel or medium is the physical or logical pathway through
which the signals travel from the sender to the receiver.
It can be wired (e.g., twisted-pair cables, coaxial cables, optical fibers) or wireless
(e.g., radio waves, microwaves, infrared).
The choice of communication channel depends on factors such as distance, data
rate, cost, and environmental conditions.
5. Protocol:
A protocol is a set of rules, conventions, and standards that governs how data is
transmitted and received between devices in a network.
It defines parameters such as data format, error detection and correction, flow
control, and addressing.
Protocols ensure interoperability and reliable communication between different
devices and systems.
6. Encoder/Decoder:
Encoders and decoders are responsible for converting the
message into a format suitable for transmission and then back
into its original form upon reception.
They may perform functions such as data compression,
encryption, modulation, and demodulation.
7. Modem (Modulator-Demodulator):
A modem is a device that modulates digital signals into analog signals for
transmission over analog communication channels and demodulates analog
signals back into digital signals upon reception.
It enables communication between digital devices over analog communication
networks such as telephone lines.
8. Switching and Routing Equipment:
Switches and routers are network devices that direct data traffic between multiple
devices and networks.
They ensure that data packets are delivered to their intended destinations
efficiently and securely.
Switches operate at the data link layer (Layer 2) of the OSI model, while routers
operate at the network layer (Layer 3).
9. Multiplexers/Demultiplexers:
Multiplexers combine multiple signals or data streams into a single transmission
channel, allowing for more efficient use of bandwidth.
Demultiplexers separate the combined signals back into their original individual
signals upon reception.
4. Asynchronous Mode:
In asynchronous mode, data transmission is not synchronized with a common
clock signal between the sender and receiver.
Each data character is preceded by start and stop bits to indicate the beginning
and end of the data transmission.
Asynchronous communication is commonly used in serial communication
interfaces, such as RS-232.
5. Synchronous Mode:
In synchronous mode, data transmission is synchronized with a common clock
signal shared between the sender and receiver.
Data is transmitted in blocks or frames, with each frame preceded by
synchronization bits or headers.
Synchronous communication allows for higher data rates and more efficient
bandwidth utilization.
Examples of synchronous communication protocols include Ethernet and
SONET/SDH.
transfer speed, reliability, and cost considerations.
BASIS FOR
SIMPLEX HALF DUPLEX FULL DUPLEX
COMPARISON
Communication is Communication is
Direction of Communication is
two-directional but, two directional and
Communication unidirectional.
one at a time. done simultaneously.
The half-duplex and The full duplex Full duplex has better
full duplex yields mode yields higher performance as it
Performance
better performance performance than doubles the utilization
than the Simplex. half duplex. of bandwidth.
Keyboard and
Example Walkie-Talkies. Telephone.
monitor.
5. Cost-Effective: Fewer wires or cables are required, making it cheaper and simpler
to implement for longer distances.
6. Examples:
o USB (Universal Serial Bus)
o RS-232
o I2C
o SPI
o Ethernet (in certain applications)
Types of Serial Communication:
Half-Duplex: Data can be sent and received, but not at the same time. (e.g.,
walkie-talkies).
Full-Duplex: Data can be sent and received simultaneously. (e.g., telephone
lines, modern Ethernet).
PG TRB (2022) Question
Q1. Serial transmission rate is specified in:
A) bits per second B) bits per minute
C) bits per hour D) bits per millisecond
Ans: A) bits per second
1.3.2. Parallel Communication
In parallel communication, multiple bits of data are transmitted simultaneously
over multiple channels or wires. This allows for faster transmission but is limited
by distance and other factors.
Key Characteristics:
1. Multiple Bits at Once: Data is transmitted multiple bits at a time (e.g., 8 bits in
parallel) over multiple channels or wires.
2. Multiple Channels: Requires more wires, one for each bit of data.
3. Faster Speed (for short distances): Since multiple bits are transmitted
simultaneously, parallel communication can be faster for short distances.
4. Signal Degradation Over Distance: As the distance increases, signal
degradation and interference can occur, making parallel communication less
effective for long distances.
5. More Complex and Expensive: Requires more physical connections (wires or
traces), which makes it more costly and complex for long distances.
6. Examples:
o Parallel ports (e.g., old printer ports)
o Internal computer buses (e.g., CPU to memory, PCI buses)
1. Unicast
This type of information transfer is useful when there is a participation of single
sender and single recipient. So, in short, you can term it as a one-to-one
transmission.
For example, a device having IP
address 10.1.2.0 in a network
wants to send the traffic
stream(data packets) to the
device with IP address 20.12.4.2
in the other network, then
unicast comes into the picture.
This is the most common form of
data transfer over the networks.
2. Broadcast
Broadcasting transfer (one-to-all) techniques can be classified into two types :
a. Limited Broadcasting
Suppose you have to send stream of packets to all the devices over the network
that you reside, this broadcasting comes handy.
For this to achieve, it will append
255.255.255.255 (all the 32 bits of IP address
set to 1) called as Limited Broadcast
Address in the destination address of the
datagram (packet) header which is reserved
for information transfer to all the recipients
from a single client (sender) over the
network.
b. Direct Broadcasting
This is useful when a device
in one network wants to
transfer packet stream to all
the devices over the other
network.
This is achieved by
translating all the Host ID
part bits of the destination
address to 1, referred as Direct Broadcast Address in the datagram header for
information transfer.
This mode is mainly utilized by television networks for video and audio
distribution.
One important protocol of this class in Computer Networks is Address
Resolution Protocol (ARP) that is used for resolving IP address into physical
address which is necessary for underlying communication.
3. Multicast
In multicasting, one/more senders and one/more recipients participate in data
transfer traffic. In this method traffic recline between the boundaries of unicast
(one-to-one) and broadcast (one-to-all).
Multicast lets server’s direct single copies of data streams that are then simulated
and routed to hosts that request it. IP multicast requires support of some other
protocols like IGMP (Internet Group Management Protocol), Multicast
routing for its working. Also in Classful IP addressing Class D is reserved for
multicast groups.
4. Point-to-Point Communication:
In point-to-point communication, data is transmitted between two individual
nodes, typically over a dedicated communication link.
Examples include serial communication between two devices using cables or
wireless communication between two mobile devices.
5. Client-Server Communication:
In client-server communication, one or more client devices request services or
resources from a central server.
The server responds to client requests by providing the requested data or
performing the requested tasks.
This model is prevalent in networked environments, such as web browsing, email
services, and file sharing.
6. Peer-to-Peer (P2P) Communication:
Peer-to-peer communication enables direct interaction between individual nodes
without the need for a central server.
Each node can act as both a client and a server, exchanging data and resources
with other peers on the network.
P2P networks are commonly used for file sharing, distributed computing, and
decentralized applications.
7. Inter-Process Communication (IPC):
IPC facilitates communication between different processes or threads running
on the same or different devices within a network.
Methods such as pipes, sockets, shared memory, and message passing are
used for IPC in operating systems and distributed computing environments.
1.5. SIGNAL
A signal is an electromagnetic or electrical current that carries data from one
system or network to another.
In electronics, a signal is often a time-varying voltage that is also an
electromagnetic wave carrying information, though it can take on other forms,
such as current.
There are two main types of signals used in electronics: analog and digital signals.
a.) Analog Signal
Because a signal varies over time, it's helpful to plot it on a graph where time is
plotted on the horizontal, x-axis, and voltage on the vertical, y-axis.
Looking at a graph of a signal is usually the easiest way to identify if it's analog or
digital; a time-versus-voltage graph of an analog signal should
be smooth and continuous.
While these signals may be limited to a range of maximum and minimum values,
there are still an infinite number of possible values within that range.
For example:
The analog voltage coming out of your wall socket might be clamped between -
120V and +120V, but, as you increase the resolution more and more, you discover
an infinite number of values that the signal can actually be (like 64.4V, 64.42V,
64.424V, and infinite, increasingly precise values).
b.) Digital Signals
Digital signals must have a finite set of possible values.
The number of values in the set can be anywhere between two and a-very-large-
number-that's-not-infinity.
Most commonly digital signals will be one of two values -- like either 0V or 5V.
Timing graphs of these signals look like square waves.
That's the big difference between analog and digital waves. Analog waves are
smooth and continuous, digital waves are stepping, square, and discrete.
c.) Key Differences:
An analog signal is a continuous signal whereas Digital signals are time separated
signals.
Analog signal is denoted by sine waves while It is denoted by square waves
Analog signal uses a continuous range of values that help you to represent
information on the other hand digital signal uses discrete 0 and 1 to represent
information.
The analog signal bandwidth is low while the bandwidth of the digital signal is high.
Analog instruments give considerable observational errors whereas Digital
instruments never cause any kind of observational errors.
Analog hardware never offers flexible implementation, but Digital hardware offers
flexibility in implementation.
Analog signals are suited for audio and video transmission while Digital signals
are suited for Computing and digital electronics.
d.) Characteristics Of Analog Signal
Here, are essential characteristics of Analog Signal
These type of electronic signals are time-varying
Minimum and maximum values which is either positive or negative.
It can be either periodic or non-periodic.
Analog Signal works on continuous data.
The accuracy of the analog signal is not high when compared to the digital signal.
It helps you to measure natural or physical values.
Analog signal output form is like Curve, Line, or Graph, so it may not be
meaningful.
e.) Characteristics of Digital Signals
Here, are essential characteristics of Digital signals
Digital signal are continuous signals
This type of electronic l signals can be processed and transmitted better compared
to analog signal.
Digital signals are versatile, so it is widely used.
The accuracy of the digital signal is better than that of the analog signal.
Analog Digital
It uses a continuous range of values that Digital signal uses discrete 0 and 1 to
help you to represent information. represent information.
The analog signal bandwidth is low The digital signal bandwidth is high.
It is suited for audio and video It is suited for Computing and digital
transmission. electronics.
Processing can be done in real-time and It never gives a guarantee that digital
consumes lesser bandwidth compared to signal processing can be performed in
a digital signal. real time.
Analog signal doesn't offer any fixed Digital signal has a finite number, i.e.,
range. 0 and 1.
Digital and analog transmission are two methods used to transmit data over
communication channels. These methods differ in how they represent and
transmit data signals. Here's a comparison between digital and analog
transmission:
a. Digital Transmission:
Representation: Digital transmission uses discrete, binary signals (0s and 1s) to
represent data. Each binary digit (bit) represents a specific voltage level or symbol.
Signal Characteristics: Digital signals are characterized by distinct voltage levels
or symbols, typically represented by square waveforms. These signals have well-
defined thresholds for interpreting 0s and 1s.
Noise Immunity: Digital signals are less susceptible to noise and interference
compared to analog signals. They can be regenerated and cleaned up using
repeaters and error correction techniques, resulting in improved signal integrity.
Bandwidth Efficiency: Digital transmission allows for higher data transmission
rates and greater bandwidth efficiency compared to analog transmission. Multiple
digital signals can be transmitted simultaneously over the same communication
channel using techniques like multiplexing.
Examples: Ethernet, Fiber Optic Communication, Digital Subscriber Line (DSL),
Satellite Communication.
b. Analog Transmission:
Representation: Analog transmission uses continuous, varying signals to
represent data. These signals can take on an infinite number of values within a
specified range.
Signal Characteristics: Analog signals have continuously varying voltage levels
or waveforms that represent the original data. They can be affected by noise,
distortion, and attenuation during transmission.
Noise Sensitivity: Analog signals are more susceptible to noise and distortion
compared to digital signals. Noise and interference can degrade the quality of the
signal and result in errors during data transmission.
Bit rate and baud rate are not always the same.
The bit rate is the number of bits transmitted per second,
The baud rate is the number of signal units transmitted per second and one
signal unit is able to represent one or more bits.
Therefore, baud rate is always less than or equal to the bit rate but never
greater.
2. If there are 10 baud per second and each baud contains 4 bit then what is bit
rate? 10*4=40 bps
3. If there are 10 baud per second and the bit rate is 40 bps then how many signal
elements are there? 40/10=4 bits/baud.
Example:
1.) An analog signal has a bit rate of 8000 bps and a baud rate of 1000.
Then analog signal has _____ signal elements and carry _____ data elements in
each signal.
(A) 256, 8 bits (B) 128, 4 bits
(C) 256, 4 bits (D) 128, 8 bits
Answer: (A)
Explanation:
Analog signal has a bit rate of 8000 bps and a baud rate of 1000. So, each signal
will clearly carry bit rate / baud rate bits.
i.e. 8000 / 1000 = 8 bits and 28 = 256 signal.
So, option (A) is correct.
CHAPTER 1.5 MCQ
1. The speech signal is obtained after
(a) Analog to digital conversion (b) Digital to analog conversion
(c) Modulation (d) Quantization
2. What type of data is typically represented by analog signals?
(a) Text documents (b) Images and graphics
(c) Audio and video (d) Binary code
3. What type of data is typically represented by digital signals?
(a) Analog sound waves (b) Continuous video streams
(c) Text documents and numerical data (d) Analog voltage levels
4. Which of the following statements is true regarding noise immunity?
(a) Analog signals are more immune to noise than digital signals
(b) Digital signals are more immune to noise than analog signals
(c) Analog and digital signals have equal immunity to noise
(d) Noise does not affect either analog or digital signals
5. Before data can be transmitted, they must be transformed to ________.
(a) periodic signals (b) electromagnetic signals
(c) aperiodic signals (d) low-frequency sine waves
6. A periodic signal completes one cycle in 0.001 s. What is the frequency?
(a) 1 Hz (b) 100 Hz (c) 1 KHz (d) 1 MHz
7. In a frequency-domain plot, the horizontal axis measures the ________.
(a) Peak amplitude (b) Frequency
2.1 Tags 5
2.2 Basic Web Page 5
2.3 Heading Tags 8
2.4 Paragraph Tag 8
2.5 Line Break Tag 9
2.6 Center Tag 10
2.7 Horizontal Rule Tag 10
2.8 Preserve Formatting Tag 11
2.9 Non-Breaking Spaces 12
2.10 Comment Lines Tag 12
CHAPTER 3 : FORMATTING AND FONTS
3.1 HTML Formatting 14
3.2 Bold Text 14
3.3 Italic Text 15
3.4 Underlined Text 16
3.5 Strong Text 16
3.6 Emphasizing Text 17
3.7 Mark Text 17
3.8 Monospaced Text 18
3.9 Strike Text 19
3.10 Subscript Text 20
1
3.11 Superscript Text 20
3.12 Insert Text 21
3.13 Deleted Text 21
3.14 Big Text 22
3.15 Small Text 23
3.16 Text Styles 23
3.17 Other Text Effects 26
CHAPTER 4: WORKING WITH COLOUR
4.1 Introduction 27
4.2 Color Values 27
4.2.1. Named Colors 28
4.2.2.Hexadecimal Color Codes 28
4.2.3.RGB (Red, Green, Blue) 28
4.2.4.RGBA (RGB with Alpha Transparency) 28
4.2.5. HSL (Hue, Saturation, Lightness) 28
4.2.6.HSLA (HSL with Alpha Transparency) 28
CHAPTER 5.CHOOSING BACKGROUND AND FOREGROUND COLORS
5.1 Introduction 29
6.1 Introduction 33
2
7.6 Border 36
7.7 Width 39
7.8 Caption 40
7.9 Align 41
3
11.6 Frame Border 81
11.7 Frames Inside Other Frames 83
11.8 No frames Tag 84
11.9 Creating More Complex Layouts 86
11.10 Setting a Hyperlink Target Frame 89
CHAPTER 12: FORMS AND CONTROLS
12.1 Introduction 91
12.2 Text Inputs 93
12.3 Buttons 94
12.4 Using Images For Buttons 95
12.5 Checkboxes 96
12.6 Radio Buttons 97
12.7 Select Boxes 98
12.8 File Select Boxes 100
12.9 Date and Time Selector 100
12.10 Number Selector 101
12.11 Range Control 102
12.12 Email Control 102
12.13 URL Control 103
12.14 Hidden Controls 103
12.15 Object Controls 103
CHAPTER 13: CASCADING STYLE SHEETS
13.1 Introduction to Cascading Style Sheet 104
13.2 A Basic Example 104
13.3 Constructing Style Rules 107
13.4 Where You Can Add CSS Rules 108
13.5 Creating Style For Nested Tags 108
13.6 Inheritance 109
13.7 The <Link> Element 110
13.8 The <Style> Element 111
13.9 CSS Properties 111
13.10 Applying Styles To Hyperlinks 112
13.11 Creating And Linking To External Style Sheets 113
13.12 Advantages Of External CSS Style Sheets 114
CHAPTER 14: CSS BACKGROUND IMAGES
14.1 Introduction 116
14.2 CSS Background-Image 116
14.3 Property Values 117
14.4 CSS Background-Repeat 124
14.5 CSS Background-Attachment 124
4
14.6 CSS Background-Position 125
CHAPTER 15: CSS COLOUR AND PROPERTIES
15.1 Introduction 125
15.2 Using Color Keywords 125
15.3 Property Values 127
15.4 Initial 130
15.5 Inherit 131
15.6 Built-In Color 133
CHAPTER 16:MANIPULATING TEXTS USING FONTS
16.1 Basic Text Formatting 136
16.2 CSS Text Formatting Properties 136
16.3 Text Pseudo-Classes 142
16.4 Specifying A Font Family 143
16.5 Specifying A Font Size and Color 144
16.6 Applying Bold And Italics 146
16.7 Applying Strikethrough and Underlining 146
16.8 Creating Inline Spans 147
16.9 Adjusting Spacing Between Letters 148
CHAPTER 17:BORDER AND BOXES MARGINS, PADDING LISTS
17.1 Introduction 149
17.2 Padding Property 150
17.3 Border Property 151
17.4 Margin Property 151
17.5 Applying A Border To A Paragraph 154
CHAPTER 18:POSITIONING USING CSS
18.1 Introduction 157
18.2 Static (Default) 158
18.3 Relative 158
18.4 Absolute 158
18.5 Fixed 158
18.6 Sticky 158
CHAPTER 19: MENU AND DIVISION
19.1 Introduction 161
19.2 Menu In CSS And Its Types 162
19.3 Types of Style Sheets 163
19.4. Banner Tag 164
CHAPTER 20: CLASS AND ID
20.1 Introduction 168
20.2 Id Selector 168
20.3 Class Selector 169
5
20.4 CSS Class Selector For A Specific Element 170
CHAPTER 21: SELECTORS
21.1 Introduction 171
21.2 Universal Selector 171
21.3 The Type Selector 171
21.4 The Class Selector 172
21.5 The Id Selector 172
21.6 The Child Selector 172
21.7 The Descendant Selector 172
21.8 The Adjacent Sibling Selector 172
21.9 The General Sibling Selector 172
21.10 Using Child and Sibling Selectors to Reduce Dependence on Classes in 173
Markup
21.11 Attribute Selectors 174
CHAPTER 22: INLINE MENU
22.1 Introduction 178
22.2 Characteristics of Inline Menus 178
22.3 Advantages of Inline Menus 178
22.4 Where Inline Menus Are Used 179
22.5 Limitations 180
CHAPTER 23: DIV AND CSS LAYOUT
23.1 Introduction 180
23.2 Definition 180
23.3 Purpose 180
23.4 CSS Layout Using <Div> 180
23.5 Benefits Of Using <Div> And CSS Layouts 181
CHAPTER 24: JAVASCRIPT
24.1 Introduction To JavaScript 188
24.2 History of JavaScript 188
24.3 Features of JavaScript 188
24.4 Application of JavaScript 189
24.5 How To Add Script To Your Webpages 189
24.6 Comments In JavaScript 190
CHAPTER 25: VARIABLES AND DATA TYPES
25.1 Variables 191
25.2 Assigning a Value to a Variable 191
25.3 Data Types 191
25.4 JavaScript Primitive Data Types 192
25.5 JavaScript Non-Primitive Data Types 192
25.6 Statements 193
6
CHAPTER 26: LOOP & ARRAYS
26.1 Looping Statement 195
26.2. Arrays 197
CHAPTER 27: FUNCTIONS
27.1 Introduction 206
27.2 How to Define A Function 206
27.3 How to Call A Function 207
27.4 The Return Statement 207
27.5 JavaScript ISNAN() Function 208
CHAPTER 28: WORKING WITH ALERT, CONFIRM AND PROMPT BOXES
28.1 Message Box 212
28.2 Dialog Boxes 212
28.3 Alert Boxes 212
28.4 Confirm Boxes 213
28.5 Prompt Boxes 214
CHAPTER 29: CREATING ROLLOVER IMAGE
29.1 Introduction 215
29.2 How Image Rollovers Work 215
29.3 Step-By-Step Implementation 215
29.4 Explanation Of Key Parts 218
29.5 Real-World Use Cases 218
CHAPTER 30: WORKING WITH OPERATORS
30.1 Introduction 220
30.2 Arithmetic Operators 220
30.3 Assignment Operators 220
30.4 Comparison Operators 221
30.5 Logical or Boolean Operators 221
30.6 String Operator (Using + With Strings) 222
CHAPTER 30: EVENTS
30.1 Introduction 222
30.2 Event Handlers 223
30.3 Mouse Events 223
30.4 Keyboard Events 223
30.5 Form Events 223
30.6 Window/Document Events 223
POSSIBLE / IMPORTANT QUESTIONS 228
7
Page 1 of 242
Elements of HTML: Working with Tables, working with Images, Working with Links, List
CSS: Introduction to Cascading Style Sheet, using CSS background images, color
and properties, manipulating texts using fonts, border and boxes margins, padding lists,
Menu and Division: Types of Style Sheets, Class and ID, selector, Inline Menu, DIV and CSS layout
Functions, working with alert, confirm and prompt boxes, Creating Rollover image, Working with
Operators, Events.
BOOKS TO STUDY:
1) Microsoft Step By Step Html And Xh,Faithe Wempen Prentice Hall Of India Private Limited
2) Jon Duckett, "Beginning HTML, XHTML, CSS and Java script", Wiley Publishing.
5) David R.Brooks, “An Introduction to HTML and JavaScript for Scientists and Engineers
HTML 2.0: This was the next version which was released in 1995, and it was standard
language version for website design. HTML 2.0 was able to support extra features such
as form-based file upload, form elements such as text box, option button, etc.
HTML 3.2: HTML 3.2 version was published by W3C in early 1997. This version was
capable of creating tables and providing support for extra options for form elements. It
can also support a web page with complex mathematical equations. It became an official
standard for any browser till January 1997. Today it is practically supported by most of
the browsers.
HTML 4.01: HTML 4.01 version was released on December 1999, and it is a very stable
version of HTML language. This version is the current official standard, and it provides
added support for stylesheets (CSS) and scripting ability for various multimedia elements.
HTML5 : HTML5 is the newest version of HyperText Markup language. The first draft
of this version was announced in January 2008. There are two major organizations one is
W3C (World Wide Web Consortium), and another one is WHATWG (Web Hypertext
Application Technology Working Group) which are involved in the development of
HTML 5 version, and still, it is under development.
1.5. OBJECTIVES OF HTML
Recognize the components of an HTML file and create such a file
Link to local files and Web pages from their Web pages.
Add graphics and sound to their Web pages using HTML.
Create different kinds of lists to their Web page using HTML.
Create a multi-column and multi-row tables using HTML.
Set background colors and graphics for Web pages.
Evaluate Web page design and consider design issues that affect web pages.
Add links to sites from their Web pages.
Tailor web design and development to Interlink Environment.
HTML is the lingua franca of the Internet. Publishing HTML-formatted documents on the
Internet via the World Wide Web proved to be the answer to these needs.
HTML is a subset of the Standard Generalized Markup Language (SGML). SGML is an
international standard (ISO 8879) published in 1986 as a format for structuring and marking up
documents.
1.6. FEATURES OF HTML
It is a very easy and simple language. It can be easily understood and modified.
It is very easy to make an effective presentation with HTML because it has a lot of formatting
tags.
It is a markup language, so it provides a flexible way to design web pages along with the text.
It facilitates programmers to add a link on the web pages (by html anchor tag), so it enhances
the interest of browsing of the user.
It is platform-independent because it can be displayed on any platform like Windows, Linux,
and Macintosh, etc.
It facilitates the programmer to add Graphics, Videos, and Sound to the web pages which makes
it more attractive and interactive.
HTML is a case-insensitive language, which means we can use tags either in lower-case or
upper-case.
EXERCISE 1:
1) What is the main purpose of HTML?
a) To style web pages
b) To add interactivity
c) To create the structure of web pages
d) To manage databases
2) Which of the following is NOT a feature of HTML?
a) Platform-independent
b) Easy to learn
c) Supports database management
d) Works on all browsers
3) HTML is classified as a:
a) Programming language c) Markup language
b) Styling language d) Scripting language
4) Which version of HTML introduced semantic tags like <article> and <section>?
a) HTML 3.2 c) HTML5
b) HTML 4.01 d) XHTML
5) HTML stands for -
a) High Text Machine Language
b) Hyper Text and links Markup Language
c) Hyper Text Markup Language
d) None of these
2.1. TAGS:
HTML tags are the fundamental elements of HTML used for defining the structure of the
document. These are letters or words enclosed by angle brackets (< and >).
Usually, most of the HTML tags contain an opening and a closing tag. Each tag has a different
meaning, and the browser reads the tags and displays the contents enclosed by them
accordingly.
For example, if we wrap any text in the paragraph (<p></p>) tag, the browser displays it as a
separate paragraph. In this chapter, we will discuss all the basic tags in HTML.
2.2. BASIC WEB PAGE
<HTML>
<HEAD>
<TITLE> TCA </TITLE>
</HEAD>
<BODY>
This is my first web page.
</BODY>
</HTML>
2.2.1.HTML Tag
As shown in Figure <HTML> is a starting tag. To delimit the text inside, add a closing tag by
adding a “/” to the starting tag. Most but not all tags have a closing tag. It is necessary to write
the code for an HTML page between <HTML> and </HTML>.
Think of tags as talking to the browser or, better still, giving it instructions. What you have just
told the browser is 'this is the start of an HTML document' (<HTML>) and 'this is the end of an
HTML document' (</HTML>). Now you need to put some matter in between these two
markers.
2.2.2. HEAD Tag
It should be the first element inside the <html> element, which contains the metadata
(information about the document). It must be closed before the body tag opens.
Every HTML document is segregated into a HEAD and BODY. The information about the
document is kept within <HEAD> tag. The BODY contains the page content.
2.2.3. TITLE Tag
The only thing you have to concern yourselves with in the HEAD tag (for now) is the TITLE
tag.
The bulk of the page will be within the BODY tag, as shown in Figure.
<HEAD>
<TITLE> TCA </TITLE>
</HEAD>
Here the document has been given the title TCA. It is a good practice to give a title to the
document created.
What you have made here is a skeleton HTML document. This is the minimum required
information for a web document and all web documents should contain these basic components.
Secondly, the document title is what appears at the very top of the browser window.
2.2.4. BODY Tag
If you have a head, you need a body. All the content to be displayed on the web page has to be
written within the body tag. So whether text, headlines, textbox, checkbox or any other possible
content, everything to be displayed must be kept within the BODY tag as shown in Figure.
Whenever you make a change to your document, just save it and hit the Reload/Refresh button
on your browser. In some instances, just hitting the Reload/Refresh button doesn’t quite work.
In that case hit Reload/Refresh while holding down the SHIFT key.
The BODY tag has following attributes:
1) BGCOLOR: It can be used for changing the background color of the page. By default the
background color is white.
2) BACKGROUND: It is used for specifying the image to be displayed in the background
of the page.
3) LINK: It indicates the color of the hyperlinks, which have not been visited or clicked on.
4) ALINK: It indicates the color of the active hyperlink. An active link is the one on which
the mouse button is pressed.
5) VLINK: It indicates the color of the hyperlinks after the mouse is clicked on it.
6) TEXT: It is used for specifying the color of the text displayed on the page.
Consider the following example:
<HTML>
</BODY>
</HTML>
The <p> tag offers a way to structure your text into different paragraphs. Each paragraph of
text should go in between an opening <p> and a closing </p> tag.
Example
<html>
<head>
<title>
Paragraph Example
</title>
</head>
<body>
<p>Here is a first paragraph of text.</p>
<p>Here is a second paragraph of text.</p>
<p>Here is a third paragraph of text.</p>
</body>
</html>
www.tcaexamguide.com (9566535080; 9786269980; 76399 67359; 93602 68118 )
Page 9 of 242
You can use <center> tag to put any content in the center of the page or any table cell.
Example
<html>
<head>
<title> Centring Content Example</title>
</head>
<body>
<p>This text is not in the center.</p>
<center>
<p>This text is in the center.</p>
</center>
</body>
</html>
This will produce following result
Horizontal lines are used to visually break-up sections of a document. The <hr> tag creates a
line from the current position in the document to the right margin and breaks the line
accordingly.
For example, you may want to give a line between two paragraphs as in the given example
below:
<html>
<head>
<title>Horizontal Line Example</title>
</head>
<body>
<p>This is paragraph one and should be on top</p>
<hr />
<p>This is paragraph two and should be at bottom</p>
</body>
</html>
Again <hr /> tag is an example of the empty element, where you do not need opening and
closing tags, as there is nothing to go in between them.
The <hr /> element has a space between the characters hr and the forward slash. If you omit
this space, older browsers will have trouble rendering the horizontal line, while if you miss the
forward slash character and just use <hr> it is not valid in XHTML.
2.8. PRESERVE FORMATTING TAG
Sometimes, you want your text to follow the exact format of how it is written in the HTML
document. In these cases, you can use the preformatted tag <pre>.
Any text between the opening <pre> tag and the closing </pre> tag will preserve the formatting
of the source document.
Example
<html>
<head>
<title>Preserve Formatting Example</title>
</head>
<body>
<pre>
function testFunction( strText )
{
alert (strText)
}
</pre>
</body>
</html>
This will produce the following result
2.9.NON-BREAKING SPACES
Suppose you want to use the phrase "12 Angry Men." Here, you would not want a browser to
split the "12, Angry" and "Men" across two lines.
An example of this technique appears in the movie "12 Angry Men."
In cases, where you do not want the client browser to break text, you should use a nonbreaking
space entity instead of a normal space. For example, when coding the "12 Angry Men"
in a paragraph, you should use something similar to the following code:
<html>
<head>
<title>
Nonbreaking Spaces Example
</title>
</head>
<body>
<p>
An example of this technique appears in the movie "12 Angry Men."
</p>
</body>
</html>
This will produce the following result
EXERCISE 2:
1) What is the correct syntax for an HTML tag?
a) <tag> c) (tag)
b) [tag] d) <tag>
2) Which of the following is a pair tag?
a) <img> c) <p>
b) <br> d) <hr>
3) What is the purpose of the <head> tag?
a) To define the header section of a web page
b) To contain metadata and links to styles/scripts
c) To define content visible on the web page
d) To display the page title
4) Which of the following is NOT part of the <head> section?
a) <title> c) <link>
b) <meta> d) <body>
1 <b> This is a physical tag, which is used to bold the text written between it.
4 <strong> This is a logical tag, which tells the browser that the text is important.
7 <tt> This tag is used to appear a text in teletype. (not supported in HTML5)
8 <strike> This tag is used to draw a strikethrough on a section of text. (Not supported in
HTML5)
13 <big> This tag is used to increase the font size by one conventional unit.
</head>
<body> <p>The following word will be in a <i>italicized</i> typeface.</p>
</body>
</html>
The above code will produce the following output:
</head>
<body>
<h1>Example of strong tag</h1>
<h2>Weather forecasting</h2>
<p>The weather is not good today.
<strong>It may heavy rain today, so it will better to be in your home.</strong>
</p>
</body>
</html>
The above code will produce the following output:
UNIT-10
CYBER SECURITY SYLLABUS
Refference Books:
1. “Cyber Security Essentials” by James Graham Richard Howard Ryan
Olson, Taylor & Francis Group
2. “Introduction to Cyber Security”, Chwan-Hwa(john) Wu,J. David Irwin, CRC
Press T&FGroup.
3. “Cyber Security Understanding Cyber Crimes,Computer Forensics and
Legal Perspectives”,Wiley by Nina Godbole and SunitBelpure
4. “Introduction to Cyber Security” by Jeetendra Pande, Uttarakhand Open
University, Haldwani.
5. “Everyday Cybersecurity” by Christopher K. COX
2
Characteristics:
Access to Internal Resources: Insiders already have access to systems, making it
easier to execute attacks.
Motives: Can include financial gain, revenge, espionage, or negligence.
Examples of Perpetrators: Employees, disgruntled staff, former employees, or
contractors.
Examples:
1. Data Theft: Stealing sensitive information like trade secrets, customer databases,
or financial records.
2. Sabotage: Deliberately damaging systems, deleting data, or disrupting operations.
3. Privileged Account Misuse: Abusing access rights to manipulate or steal data.
4. Negligence: Carelessness, such as clicking on phishing links or failing to follow
security protocols.
Prevention:
Implement strict access controls and privilege management.
Monitor insider activities using security tools (e.g., User Behavior Analytics).
Regularly audit sensitive data and systems.
Establish clear policies for cybersecurity and employee conduct.
b.) External Cybercrime
External cybercrime involves attacks initiated by individuals or groups outside the
organization. These attackers often use sophisticated techniques to bypass security
systems.
Characteristics:
Motives: Include financial gain, espionage, ideological causes, or sabotage.
Techniques Used: Phishing, hacking, malware, ransomware, etc.
Examples of Perpetrators: Hackers, cybercriminal groups, hacktivists, or nation-
state actors.
Examples:
1. Phishing Attacks: Fraudulent attempts to steal sensitive data through emails or fake
websites.
2. Hacking: Unauthorized access to systems or networks.
3. Distributed Denial of Service (DDoS): Flooding servers to disrupt services.
4. Ransomware: Encrypting data and demanding payment for its release.
5. Cyber Espionage: Stealing confidential data or intellectual property.
Prevention:
Use firewalls, intrusion detection systems, and endpoint protection.
Regularly update and patch systems to fix vulnerabilities.
Educate employees about cybersecurity best practices.
Deploy multi-factor authentication (MFA) and encryption.
Examples:
1. Advanced Persistent Threats (APTs): Long-term, stealthy attacks designed to
infiltrate and extract data from high-value targets.
2. Ransomware Campaigns: Carefully targeted attacks on organizations with the
intent to extort large sums of money.
3. Corporate Espionage: Stealing intellectual property or trade secrets using
sophisticated methods.
4. Critical Infrastructure Attacks: Targeting power grids, water supply systems, or
communication networks for geopolitical motives.
Prevention:
Employ advanced cybersecurity tools, such as Endpoint
Detection and Response (EDR) and Intrusion Detection Systems
(IDS).
Use multi-factor authentication and robust encryption.
Continuously monitor networks for anomalies.
Implement incident response plans and conduct regular threat simulations.
b.) Unstructured Attacks
Unstructured attacks are less sophisticated and often carried out by individuals with
limited technical expertise. These attacks are typically opportunistic and rely on
readily available tools.
Characteristics:
Planning: Minimal or no planning involved.
Sophistication: Relies on basic methods and tools, often freely available online.
Perpetrators: Usually amateurs or novice attackers, sometimes referred to as
"script kiddies."
Target: Generally random, without a specific victim in mind.
Duration: Short-lived and often easily detectable.
Examples:
1. Brute Force Attacks: Attempting to guess passwords using trial-and-error
methods.
2. Phishing Scams: Sending fraudulent emails to a broad audience hoping to steal
credentials.
3. Malware Distribution: Spreading basic viruses or Trojans through infected
attachments or software.
4. Website Defacement: Hacktivists or pranksters altering websites for fun or minor
political messages.
www.tcaexamguide.com ( 95665 35080; 9786269980; 76399 67359; 93602 68118 )
7
Prevention:
Educate users on basic cybersecurity practices (e.g., recognizing phishing
attempts).
Use strong passwords and change them regularly.
Keep software and systems up to date.
Install antivirus and antimalware software.
Malware stands for “Malicious Software” and it refers to any software designed
to infiltrate, damage, or exploit computers and networks without the user's consent.
Malware is normally installed and runs on your computer, smartphone, or other
device without your knowledge and/or consent. It can get onto your system by a
variety of methods, including email, web pages and links, and infected USB drives.
They perform unwanted tasks in the host computer for the benefit of a third party.
Malwares which can seriously degrade the performance of the host machine.
There is a full range of malwares which are simply written to distract/annoy the
user, to the complex ones which captures the sensitive data from the host machine
and send it to remote servers.
Steal sensitive personal, business, proprietary, or financial information.
Disrupt normal system operations.
Spy.
Lock files on the victim’s system and hold them for ransom.
Perform attacks on other systems, including distributed-denialof-service (DDoS)
attacks.
Gain unauthorized access to a system.
Send spam and other emails.
While malware can perform more than one purpose, most
malware is categorized by its main function or how it attacks the system. Some of
the popular ones are:
1.2.1. VIRUSES
Programs that attach themselves to legitimate files or software and spread when
the infected file is executed.
A virus is a malicious code written to damage/harm the host computer by deleting
or appending a file, occupy memory space of the computer by replicating the copy
of the code, slow down the performance of the computer, format the host machine,
etc.
It can be spread via email attachment, pen drives, digital images, e-greeting, audio
or video clips, etc.
A virus may be present in a computer but it cannot activate itself without the
human intervention.
Until and unless the executable file(.exe) is execute, a virus cannot be activated in
the host machine.
Purpose: Corrupt, delete, or steal data; disrupt systems.
Example: File-infecting viruses that damage executable files.
Prevention: Use antivirus software and avoid running unknown files.
Type of Viruses
1. File Infector Viruses : Infect executable files such as .exe or .com. When the
infected program is run, the virus activates. Effect: Corrupts files, slows down
system performance, or spreads further. Example: Cascade Virus.
2. Boot Sector Viruses : Target the boot sector of a hard drive or removable media
(e.g., USB drives). They execute during the system boot process. Effect: Prevent
the system from booting, corrupt critical startup files. Example: Michelangelo
Virus.
3. Macro Viruses :Written in macro languages used by software like Microsoft Word
or Excel. These viruses activate when infected documents are opened. Effect:
Execute malicious macros, corrupt documents, or steal data. Example: Melissa
Virus.
www.tcaexamguide.com ( 95665 35080; 9786269980; 76399 67359; 93602 68118 )
14
4. Polymorphic Viruses : Alter their code each time they infect a new file, making
them harder to detect by traditional antivirus software. Effect: Evades detection,
spreading widely. Example: Storm Worm.
5. Metamorphic Viruses : Rewrite their own code completely while maintaining their
functionality, making detection more challenging than polymorphic viruses.
Effect: Avoid signature-based antivirus tools. Example: Simile Virus.
6. Resident Viruses : Reside in a computer's memory and activate whenever the
operating system performs specific functions, such as file access. Effect:
Continuously infect files or programs. Example: Randex.
7. Non-Resident Viruses : Do not reside in memory. They operate by infecting files
directly and do not stay active after execution. Effect: Spread less persistently
than resident viruses. Example: Vienna Virus.
8. Multipartite Viruses : Combine multiple infection methods, targeting both files
and the boot sector. Effect: Harder to remove as they re-infect the system through
different mechanisms. Example: GhostBall Virus.
9. Web Scripting Viruses : Exploit vulnerabilities in web browsers or scripts on
websites. Effect: Redirect users to malicious websites or execute harmful scripts
on the user's device. Example: JS.Fortnight.
10. Armored Viruses : Use obfuscation techniques to make themselves more difficult
to analyze or detect. Effect: Complicates reverse engineering by cybersecurity
experts. Example: Whale Virus.
11. Overwrite Viruses : Overwrite file content with malicious code, rendering the
original file useless. Effect: Permanent loss of file data. Example: Trivial.88.D.
12. Spacefiller (Cavity) Viruses : Insert themselves into unused sections of a file to
avoid detection and maintain file functionality. Effect: Difficult to detect without
corrupting the host file. Example: Lehigh Virus.
1.2.2. WORMS
They are a class of virus which can replicate themselves.
Standalone programs that self-replicate and spread across
networks without user intervention.
They are different from the virus by the fact that they does not require human
intervention to travel over the network and spread from the infected machine to the
whole network.
Worms can spread either through network, using the loopholes of the Operating
System or via email.
The replication and spreading of the worm over the network consumes the network
resources like space and bandwidth and force the network to choke.
Purpose: Consume system resources, cause network congestion, and spread
malicious payloads.
Example: Conficker worm, which exploited vulnerabilities in Windows systems.
Prevention: Keep systems updated and use firewalls.
Type of Worms
1. Internet Worms : Spread through the internet by exploiting vulnerabilities in
software or protocols. Effect: Overwhelm networks, slow down systems, or deliver
malicious payloads. Example: SQL Slammer Worm.
2. Email Worms : Spread via email attachments or links. They often disguise
themselves as legitimate files or messages. Effect: Infect email systems, steal
data, or distribute spam. Example: Mydoom Worm.
3. File-Sharing Worms : Distribute through peer-to-peer (P2P) networks or file-
sharing platforms. Effect: Infect files shared on these platforms, spreading to users
who download them. Example: Kazaa Worm.
4. Instant Messaging (IM) Worms : Spread through instant messaging platforms by
sending malicious links or files to contacts. Effect: Compromise user accounts,
spread quickly to other contacts. Example: Bropia Worm.
5. Network Worms : Propagate through networks by exploiting unpatched
vulnerabilities in devices or protocols. Effect: Cause network congestion, steal
data, or deploy secondary payloads like ransomware. Example: Conficker Worm.
6. USB Worms : Spread through removable storage devices like USB drives by
creating hidden malicious files. Effect: Infect systems when the device is plugged
in, spreading further through connected devices. Example: Stuxnet.
7. IRC Worms (Internet Relay Chat Worms) : Spread through IRC channels by
sending malicious commands or links. Effect: Infect users connected to the same
IRC network or channel. Example: Agobot.
8. Mobile Worms : Target mobile devices, spreading through Bluetooth, SMS, or
malicious apps. Effect: Steal sensitive information, infect other devices, or cause
system malfunctions. Example: Cabir Worm.
9. Cryptoworms : Encrypt data or systems as they spread, effectively acting like a
ransomware worm. Effect: Lock systems or files, demanding payment for
decryption keys. Example: WannaCry Worm.
10. Botnet Worms : Turn infected devices into bots within a larger botnet, often used
for cyberattacks like DDoS. Effect: Gain control of large networks of compromised
devices for malicious purposes. Example: Sasser Worm.
11. Social Worms : Spread through social media platforms by sending malicious links
or posts that appear legitimate. Effect: Infect accounts, steal credentials, or
propagate further through users’ networks. Example: Koobface Worm.
12. Multi-Vector Worms : Use multiple propagation methods, such as email,
networks, and file sharing, to maximize spread. Effect: Versatile and more difficult
to contain due to their varied attack vectors. Example: Nimda Worm.
1.2.3. TROJANS
Trojan horse is a malicious code that
is installed in the host machine by
pretending to be useful software.
(NET 2014)
The user clicks on the link or
download the file which pretends to
be a useful file or software from
legitimate source.
It not only damages the host
computer by manip ulating the data but also it creates a backdoor in the host
computer so that it could be controlled by a remote computer.
It can become a part of botnet (robot-network), a network of computers which are
infected by malicious code and controlled by central controller.
The computers of this network which are infected by malicious
code are known as zombies.
Trojens neither infect the other computers in the network nor do
they replicate.
Purpose: Provide unauthorized access, steal data, or install additional malware.
Example: Remote Access Trojans (RATs) allow attackers to control a device
remotely.
Prevention: Download software only from trusted sources.
Types of Trojans
1. Backdoor Trojans : Create a backdoor in the victim's system, allowing
unauthorized access for attackers. Effect: Enable remote control of the system,
installation of other malware, or data theft. Example: Poison Ivy.
13. Mailfinder Trojans : Harvest email addresses from the victim’s system. Effect:
Send spam or phishing campaigns using stolen email data. Example: Trojan-
Mailfinder.
14. DDoS Trojans : Compromise devices to form botnets that launch Distributed
Denial of Service (DDoS) attacks. Effect: Overload target systems, making them
inaccessible. Example: Mirai Trojan.
15. Exploit Trojans : Exploit known vulnerabilities in software or systems to install
other malware or gain access. Effect: Compromise systems with outdated or
unpatched software. Example: Blackhole Exploit Kit.
16. SMS Trojans : Target mobile devices to send unauthorized SMS messages to
premium numbers or steal data. Effect: Financial loss or unauthorized access to
mobile communications. Example: FakePlayer Trojan.
1.2.4. RANSOMWARE
Encrypts the victim's files or locks them out of their
system and demands a ransom for access.
It holds the host computer hostage until the
ransom is paid. The malicious code can neither be
uninstalled nor can the computer be used till the
ransom is paid.
Purpose: Extort money from individuals or organizations.
Example: WannaCry ransomware attack in 2017. Prevention: Use regular
backups, avoid suspicious emails, and maintain updated security software.
Types of Ransomware
1. Crypto Ransomware : Encrypts the victim's files, rendering them inaccessible
until a ransom is paid. Effect: Loss of access to personal or business-critical data.
Example: WannaCry, Cryptolocker.
2. Locker Ransomware : Locks users out of their devices or systems entirely,
preventing access to anything. Effect: Denial of system use until a ransom is paid.
Example: WinLock.
3. Scareware : Uses fake warnings or alerts claiming the system is infected with
viruses or has issues, demanding payment to fix the "problem." Effect: Tricks
users into paying, though the files may not actually be encrypted. Example:
Rogue security software.
4. RaaS (Ransomware-as-a-Service) : A subscription-based model where
ransomware developers sell or lease their tools to other attackers. Effect:
Teacher’s Care Academy கடந்த 14 ஆண்டுகளாக TRB ரதர்வுகளுக்கான சிைப்பு பயிற்சிறய வழங்கி
வருகிைது. இதுவறே 10,000-க்கும் ரேற்பட்ட ஆசிரியர்கறள அேசு ரவறைகளில் வவற்றிகேோக
நியமிக்க உதவியதில் நாங்கள் வபருமிதம் வகாள்கிரைாம். எங்கள் நிறுவனத்தில் அறனத்து TRB
ரதர்வுகளுக்கும் விரிவான பயிற்சிகள் உள்ளன, அறவ:
PGTRB
UGTRB
SGT
POLYTECHNIC TRB
BEO
TET Paper I & II
College TRB
Special Teachers
TNPSC, MRB, TNUSRB) தமிழ் வோழி கட்டாய தகுதி ரதர்வு (Tamil Compulsory Exam)
முதற்கட்ட ரதர்வாக அறிவித்துள்ளது இதற்காக தமிழ் வோழி கட்டாய தகுதி ரதர்வு என்ை புத்தகத்றத
கிறடக்கிைது ஆனால் எங்கறள ரநேடியாக வதாடர்பு வகாண்டு வாங்கும் ரபாது உங்களுக்கு கூடுதல்
தள்ளுபடி கிறடக்கும்
PGTRB
PGTRB ரதர்விற்கு நாங்கள் அறனத்து வோழி பாடத்திற்கும் பயிற்சிகறள வழங்கி வருகிரைாம்
அதாவது
Tamil
English
Mathematics
Physics
Chemistry
Botany
Zoology
Economics
Commerce
Computer Science
History
ரேற்கண்ட அறனத்து படப்பிரிவுகளுக்கான Study Material-களுடன் Psychology, Tamil
Eligibility Book, Question Bank ேற்றும் General Knowldge Material-களும் வழங்கப்படும்
TET ரதர்விற்கு நம் Teachers Care Academy-யில் Paper I ேற்றும் Paper II என இேண்டு
தாள்களுக்கும் பிேத்திரயகோக பயிற்சிகறள வழங்குகிரைாம்
இதற்கு தமிழ்நாடு அேசால் வழங்கப்பட்டுள்ள பள்ளி பாட புத்தகத்தில் இருந்து குறிப்புகறள எடுத்து
Study Material-களாக வழங்குகிரைாம்
UGTRB
TET ரதர்வில் வவற்றி வபற்ை ஆசிரியர்களுக்கு நடத்தப்படும் UGTRB ரபாட்டி ரதர்வுக்காக அறனத்து
வோழி பாடத்திற்கும் பயிற்சிகறள வழங்கி வருகிரைாம் அதாவது
Tamil
English
Mathematics
Physics
Chemistry
Botany
Zoology
History
Geography
SGTRB
TET ரதர்வில் வவற்றி வபற்ை ஆசிரியர்களுக்கு நடத்தப்படும் SGTRB ரபாட்டி ரதர்வுக்காக தமிழ்நாடு
அேசால் வழங்கப்பட்டுள்ள பள்ளி பாட புத்தகத்தில் இருந்து குறிப்புகறள எடுத்து Study Material-
களாக வழங்குகிரைாம்
BEO
POLYTECHNIC TRB
Polytechnic ரதர்விற்காக உங்கள் Teachers Care Academy பின்வரும் வோழி பாடத்திற்கு பயிற்சிகறள
வழங்கி வருகிைது. அதாவது,
Civil
EEE
ECE
CSE
Mechanical
English
Mathematics
Physics
Chemistry
College TRB
தமிழ்நாட்டில் அேசு கல்லூரிகளில் காலியாக உள்ள உதவி ரபோசிரியர் பணிக்கு TRB வவகு
விறேவில் ரபாட்டித் ரதர்றவ நடத்த இருக்கிைது
அந்த ரதர்வுக்காக நம் Teachers Care Academy-யில் பின்வரும் வோழி பாடத் திட்டத்திற்கும்
பயிற்சிகறள வழங்கி வருகிைது
Tamil
English
Mathematics
Physics
Chemistry
Botany
Zoology
Economics
Commerce
Computer Science
History
Geography
Special Teachers
Sewing
Drawing
Music
PET
அன்புடன்,
Teacher’s Care Academy