You are on page 1of 17

CHAPTER 1

TYPICAL CONFIGURATION OF COMPUTER SYSTEM


1. Define hardware.
The physical components of a computer are called hardware.
Ex: keyboard, mouse etc.
2. Define software.
Software is a collection of programs that tells the computer what to do or how to do.
3. Define motherboard.
The motherboard is the main circuit board inside a computer which provides a platform
for all the components to communicate with each other.
4. Explain the characteristics of motherboard.
The characteristics of motherboard are,
a) Form factor – Form factor refers to the motherboard’s geometry, dimensions,
arrangement and electrical requirements. The most common design of motherboard is
ATX (Advanced Technology Extended).
b) Chipset – controls the majority of resources of the computer. It coordinates the data
transfer between various components of the computer.
c) Processor Socket – It may be a rectangular connector into which the processor is
mounted vertically, or a square shaped connector into which the processor is directly
inserted.
5. Mention the different types of motherboards.
XT, AT, Baby AT and ATX motherboards.
6. What is a microprocessor?
Microprocessor is an integrated circuit on a single chip that makes the computer’s CPU.
Ex: Intel.
7. Explain the different types of motherboards.
a) XT Motherboard
• XT stands for Extended Technology.
• They are old models.
• They have DIMM memory modules, ISA slots, 12 pin power connector and no ports.
• Ex: Pentium I, Pentium II, Pentium MMX.
b) AT Motherboard
• AT stands for Advanced Technology.
• They have PGA (Pin Grid Array) processor socket, SDRAM slots, ISA slots, PCI slots
and 20 pin power connectors.
• Ex: Pentium III
c) Baby AT Motherboard
• They have the combination of XT and AT.
• They have slot type processor sockets and PGA processor sockets, SDRAM slots and
DDRRAM slots, PCI slots and ISA slots, 12 pin power connector and 20 pin power connector
and ports.
• Ex: Pentium IV

II PUC COMPUTER SCIENCE 2


d) ATX Motherboard
• ATX stand for Advanced Technology Extended.
• Latest motherboards are ATX motherboards.
• They have MPGA (Micro Pin Grid Array) processor socket, DDRRAM slots, PCI slots, 20
and 24 pin connector and ports.
• Ex: Pentium IV, i3,i5,i7 processor
8. Explain the components of motherboards.
The different components of motherboard are,
a) Processor (CPU) – Itis the brain of the computer. It consists of ALU, CU and registers.
• ALU – It performs all arithmetic and logical operations.
• CU – It controls and coordinates the activities of all other units.
• Registers – It holds data and instructions temporarily.
b) BIOS – BIOS stands for Basic Input Output System. It is a small chip on the
motherboard. It runs when the computer is switched on. It performs Power on Self
Test (POST) that checks the functioning of hardware devices.
c) CMOS – CMOS stands for Complementary Metal Oxide Semiconductor. It is a type of
memory chip to store date, time and system setup parameters. It is loaded every time
when the computer is started.
d) Slots – A slot is an opening in the computer where we can insert a printed circuit
board. It is also called as expansion slots. It allows expanding the capability of a
computer. Ex: ISA slot, PCI slot
e) Disk Controllers – It allows the CPU to communicate with hard disk, floppy disk or
any other kind of disk drive. The different types are,
• Hard Disk Controller (HDC) – It is used to read and write information to the hard
drive.
• Floppy Disk Controller (FDC) – It is used to read and write information to the floppy
disk drive.
f) I/O Ports and Interfaces– A port or interface is the socket on the backside of the
computer used to connect external devices like keyboard, printer etc.
g) BUS – A bus is a collection of wires that carry address, data and control signals. The
different types of bus are internal bus and external bus.
9. Define clock speed.
A measure of a processor’s operating speed is called clock speed which is currently
measured in MHz (Megahertz) and GHz (Gigahertz).
10. Explain North and South Bridge or the chipsets on motherboard.
Two Chipsets – 1.North bridge /Host bridge/North chipset
2. South Bridge/South Chipset
o The north bridge or host bridge is used to manage data communications between
the CPU and motherboard. It controls high-speed components like CPU, RAM and
Video card.
o Southbridge is similar as North Bridge. It manages data communicationsof low
speed components like hard disk, CD ROM drive.
11. Explain the different types of slots.
a) ISA slot – ISA stands for Industrial Standard Architecture. It is used to connect
modem and input devices.

II PUC COMPUTER SCIENCE 3


b) PCI slot – PCI stands for Peripheral Component Interconnect. It is used to connect
graphics cards and sound cards.They are faster than ISA.
c) AGP slot – AGP stands for Accelerated Graphics Port. It provides a faster access to
graphic card.
d) RAM slot – It is used to install memory. a. SIMM (Single Inline Memory Module)
b. DIMM (Dual Inline Memory Module)
e) Processor slot – It is used to insert processor chip which is the largest chip. It has a
heat sink or fan located on it.
f) PC card – It is used in laptop computers. It includes Wi-Fi card and network card.
12. Explain the different types of ports
a) Serial port–It is also known as communication port. They are used to connect
devices like mouse and modem. It transfers data serially one bit at a time.
b) Parallel port – It is used to connect external devices like printers, scanners etc. It has
25 pins. It transfers data parallelly 8 bits at a time.
c) USB port – USB stands for Universal Serial Bus. It is an easy way to connect the
devices. The symbol for USB is,

It is a plug and play interface. Using USB, a new device can be added to the computer
without adding an adapter card or even switch off the computer.
Ex: pendrive, printer
d) AGP port – The AGP (Accelerated Graphics Port) port provides a faster access to
graphic card.
e) VGA port – VGA stands for Visual Graphics Adapter/Video Graphics Array. It is used
to connect monitor to a computer’s video card.
f) MODEM – MODEM stands for Modulator Demodulator. It connects a computer’s
modem to the telephone network.
g) Game port – It connects a computer to a joystick.
h) DVI port – DVI stands for Digital Video Interface. It connects the LCD monitor to a
computer’s video graphic cards.
i) MIDI port – MIDI stands for Musical Instrumental Digital Interface. It is a system
designed to transmit information between electronic musical instruments.
j) IDE(Integrated Digital Electronics) Port- IDE devices like CD-ROM or hard disk drives
are connected to the mother board through IDE Port.
k) PS-2 Port(Personal System 2 ) – Developed by IBM to interface keyboards and
pointing devices(mouse, track balls). Also called as mouse port.
l) Firewire port –It transfers large amount of data at very high speed. It connects video
equipment to the computer. Invented by Apple.
m) Ethernet port –It connects network cable to a computer.
13. Write the features of USB.
• Universal Serial Bus is an easy way to connect devices
• It is a plug and play interface
• Using USB, a new device can be added to the computer without adding an adapter
card or even switch off the computer
• Ex: pendrive, printer

II PUC COMPUTER SCIENCE 4


14. What is meant by plug and play device?
A plug and play device meansa device can be added to the computer without adding an
adapter card or even switching off the computer.
15. Explain BUS.
A BUS is a collection of wires that carries address, data and control signals.
BUS is divided into Internal Bus and External Bus.
Internal Bus connects major components like processor, memory card and I/O. It is also
called System Bus.
External Bus connects external devices, expansion slots, I/O ports and drive connections
to the rest of computer.
A system bus is of three kinds. Data bus, Address bus and Control bus.
A Data Bus provides a path to transfer data between CPU and memory.
An Address Bus provides a path to transfer address between CPU and RAM.
A Control Bus is used to control the access of the data and addresses.
16. What is memory and mention the types.
It refers to the electronic storing space for instructions and data where the processor
can reach quickly. Two types: 1. Internal Memory 2. External Memory.
17. What is cache memory?
Cache memory is a small and very high-speed memory placed between RAM and CPU.
18. Explain cache memory.
The cache memory is a high-speed memory available inside CPU to speed up access of
data and instructions stored in RAM memory. It is located between RAM and CPU. During
processing the CPU first checks the required data in the cache. If it is not found in cache,
looks in the RAM for data. It is very expensive and smaller in size.
There are 2levels of cache memory. Level1 (L1) cache or chip cache, Level2 (L2)
L1 cache is located on the CPU.
L2 cache is located on the motherboard.
19. Explain different types of RAM.
The different types of RAM are DRAM, SRAM, SDRAM and DDR – SDRAM
DRAM
• DRAM stands for Dynamic Random Access Memory
• It is the most common type of memory chip
• DRAM is cheaper and they consume less power
• It uses transistor and capacitors
SRAM
• SRAM stands for Static Random Access Memory
• Static RAM chip is usually used in cache memory due to its high speed
• It stores information as long as the power supply is on
• SRAM is more expensive than DRAM and it takes up more space
SDRAM
• SDRAM stands for Synchronous Dynamic Random Access Memory
• It is synchronized to the system clock
• Since it is synchronized to the CPU, it knows when the next cycle is coming
and has the data ready when the CPU requests it

II PUC COMPUTER SCIENCE 5


DDR – SDRAM
• DDR SDRAM stands for Double Data Rate Synchronous Dynamic Random Access
Memory
• It works the same way as SDRAM
• But the data transfer rate is double when compared to SDRAM
20. What are the different types of power supply?
• Switch Mode Power Supply (SMPS)
• Uninterrupted Power Supply (UPS)
21. Write a note on SMPS
• SMPS stands for Switch Mode Power Supply
• It converts 230 volts of AC power from an electrical outlet to 5 to 12 volts of DC
power needed by the system components.
• It has a power card plug and a fan for cooling because it generates a lot of heat.
22. What is the function of UPS? Mention the types of UPS.
UPS keeps the computer running for several minutes even after the power failure. The
types of UPS are,
• Online UPS
• Standby UPS/Offline UPS
23. Explain the types of UPS.
The two types of UPS are online UPS and standby UPS.
Online UPS
• An online UPS provides power from its own inverter even when the power line is
functioning properly.
• An online UPS is more costly than standby UPS.
Standby UPS/Offline UPS
• It is also known as offline UPS.
• A standby UPS monitors the power line and switches to battery power when it
detects a problem. The switch over to battery takes several milliseconds, during that time
computer is not receiving any power.

II PUC COMPUTER SCIENCE 6


CHAPTER 4
DATA STRUCTURES
1. What is a data structure?
Data structure is a specialized format for organizing and storing data.
2. Mention the two types of data structure.
• Primitive data structure
• Non-primitive data structure
3. What is a primitive data structure?
Data structures that are directly operated upon by machine level instructions are known
as primitive data structures.
4. Give two examples of primitive data structure.
integer, float
5. Explain various operations performed on primitive data structure.
The various operations performed on primitive data structure are,
• Create – Create operation is used to create a new data structure. It reserves memory
space at compile and run time.
Ex: int i;
It allocates memory space for ‘i’ during the compilation.
• Destroy – It is used to remove the data structures from the memory space.
• Select – Select operation is used by programmers to access data within data structure.
• Update – Update operation is used to change data in the data structure.
Ex: int i=2;
i=4;
It updates the value of i with the new value.
6. What is non-primitive data structure?
Data structures that cannot be directly operated upon by machine level instructions and
are derived from the primitive data structures are known as non – primitive data structure.
7. Give two examples of non – primitive data structure.
Array, Stack, Queue, Linked List
8. Mention the different types of non – primitive data structure.
• Linear data structure
• Non - linear data structure
9. What are linear data structures?
Linear data structures are a kind of data structure that has homogeneous elements. Data
elements are stored with adjacency.
10. Give examples of linear data structure.
Stack, queue, linked list
11. Explain different operations performed on linear data structure.
Traversing – The process of accessing each element exactly once to perform some
operations is called traversing.
Insertion – The process of adding a new element into the existing data structure is
called insertion.
Deletion – The process of removing an existing element from the data structure is
called deletion.

II PUC COMPUTER SCIENCE 22


Searching – The process of finding the location of an element in the given collection of
elements is called searching.
Sorting – The process of arranging the elements in ascending or descending order is
called sorting.
Merging – The process of combining the data elements of two structures to form a
single structure is called merging.
12. What are non – linear data structures?
A non – linear data structure is a data structure in which a data item is connected to several
other data items.
13. Give two examples of non – linear data structure.
Trees, Graphs
14. What is an array?
An array is a collection of homogeneous elements with same datatype and same name.
15. Mention the types of arrays.
• One dimensional array
• Two-dimensional array
• Multi-dimensional array
16. Explain the representation of one-dimensional array.
• Elements of one-dimensional array are stored in consecutive memory locations.
• Each element is accessed by an index(subscript).
The memory representation:
We can calculate the address/location of any element by the formula,
Address(A[I]) = Base Address + W(I - LB)
where, Base Address – Address of the first element
W is the word length
I is the location index
LB is the lower bound.
1000 1001 1002 1003 1004
A B C D E

A[0] A[1] A[2] A[3] A[4]

We can calculate the address of A[3] as follows,


Address(A[3]) = Base Address + W(P – LB)
= 1000 + 1(3 – 0)
= 1003+3=1003
17. Explain the different basic operations on one dimensional array.
• Traversing - The process of accessing each element of the array exactly once to
perform some operations is called traversing.
• Insertion – The process of adding a new element into array is called insertion.
• Deletion – The process of removing an existing element from the array is called
deletion.
• Searching – The process of finding the location of an element in the array is called
searching.

II PUC COMPUTER SCIENCE 23


• Sorting – The process of arranging the elements in ascending or descending order
is called sorting.
• Merging – The process of combining two or more arrays to form a single array is called
merging.
18. Write an algorithm for traversing a Linear Array.
Step1: Start
Step2: for loc= LB to UB
Process A[loc]
End of for
Step3: Exit
19. Write an algorithm of linear search.
Step 1: LOC = -1
Step 2: for P=0 to N – 1
If (A[P] = ELE)
LOC = P
GOTO Step3
End of if
End of for
Step 3: if (LOC >= 0)
PRINT LOC
Else
PRINT “Search is unsuccessful”
End if
Step 4: Exit
20. Write an algorithm to search an element using binary search.
A – Sorted Array
BEG – Beginning location
END– End location
MID– Middle location
ELE – Searching element
LOC – Position of the element
Step 1: LOC= -1
Step 2: while (BEG<= END)
M= (BEG+ END)/2
If (ELE = A[MID])
LOC=MID
GOTO Step 3
Else if (ELE< A[MID])
END = MID - 1
Else
BEG= MID + 1
End if
End of while
Step 3: if (LOC>= 0)
PRINTLOC
Else

II PUC COMPUTER SCIENCE 24


PRINT “Search is unsuccessful”
End if
Step 4: Exit
21. Apply binary search for the following sequence of numbers 10, 20, 30, 35, 40, 45, 50,
55, 60. Search for the item 35.

Array Variables Compare Loc

10 20 30 35 40 45 50 55 60 Beg = 0 35<40 Loc= -1


End = 8
Mid(0+8) /2 = 4
0 1 2 3 4 5 6 7 8

Beg Mid End


End

10 20 30 35 40 45 50 55 60
Beg = 0
0 1 2 3 4 5 6 7 8 End = 3 35>20 Loc= -1
Mid (0+3)/2
Beg Mid End =1

10 20 30 35 40 45 50 55 60
Beg = 2 35>30 Loc= -1
End = 3
0 1 2 3 4 5 6 7 8 Mid(2+3)/2 = 2

Beg End
Mid

10 20 30 35 40 45 50 55 60 Beg = 3
End = 3 35=35 Loc= 3
Mid = 3
0 1 2 3 4 5 6 7 8

Beg
End
Mid

Therefore, element 35 is found in the location 3.

22. Write an algorithm to insert an item/element in an array.


Step 1: For I=N – 1 down P
A[I+1] = A[I]
End of For

II PUC COMPUTER SCIENCE 25


Step 2: A[P] = Item
Step 3: N=N+1
Step 4: Exit

23. Write an algorithm to delete an element in an array.


Step 1: Item = A[P]
Step 2: For I=P to N – 1
A[I] = A[I+1]
End of For
Step 3: N = N – 1
Step 4: Exit
24. Mention the various sorting methods.
a. Bubble Sort
b. Shell Sort
c. Insertion Sort
d. Selection Sort
e. Quick Sort
25. Write an algorithm to sort an array using insertion sort.
Step 1: For I=1 to N – 1
Step 2: J = I
Step 3: while (J>=1)
If (A[J] < A [J – 1])
Temp = A[J]
A[J] = A [ J – 1]
A [ J – 1] = Temp
End of if
Step 4: J = J – 1
End of while
End of For
Step 5: Exit
26. What is Two-dimensional array?
A two dimensional array is a collection of elements and each element is identified by a
pair of indices.
27. Explain memory representation of two-dimensional array using row major order.
Let A is a two-dimensional array of 3 rows and 3 columns.

A[0] A[1] A[2]

A[0] 5 6 7

A[1] 3 2 1

A[2] 10 20 30

II PUC COMPUTER SCIENCE 26


In row major order, first row elements are stored in sequential memory locations, then
second row elements and so on. i.e,
Phy.Addr Elements Logi.Addr

1001 5 A[0][0]
First Row
1002 6 A[0][1]
1003 7 A[0][2]
1004 3 A[1][0]
Second Row
1005 2 A[1][1]
1006 1 A[1][2]
1007 10 A[2][0]
Third Row
1008 20 A[2][1]
1009 30 A[2][2]

28. Explain memory representation of two – dimensional array using column major order.
Ans. Let A is a two-dimensional array of 3 rows and 3 columns.
For example, consider an array of order 3x3.
A[0] A[1] A[2]

A[0] 5 6 7

A[1] 3 2 1

A[2] 10 20 30

In column major order, first column elements are stored in sequential memory locations,
then second column elements and so on.

Phy.Addr Elements Logi.Addr


1001 5 A[0][0]
First Column
1002 3 A[1][0]
1003 10 A[2][0]
1004 6 A[0][1]
Second Column
1005 2 A[1][1]
1006 20 A[2][1]
1007 7 A[0][2]

II PUC COMPUTER SCIENCE 27


1008 1 A[1][2] Third Column
1009 30 A[2][2]

29. Write the applications of array.


• Arrays are used to implement other data structures such as queues, stacks and
strings etc.
• Arrays are used to implement mathematical vectors and matrices
• Many databases include one - dimensional arrays whose elements are records
30. What are the advantages of arrays?
• It is used to represent multiple data items of same type by using only single name
• It can be used to implement other data structures like stacks, queues etc.
• Two – dimensional arrays are used to represent matrices
• Many databases include one – dimensional arrays whose elements are records
31. What are the disadvantages of arrays?
• We must know in advance that how many elements are to be stored in an array.
• The memory is allocated to array cannot be increased or reduced.
• If we allocate less memory than requirement, then it will create problem.
32. What is a stack?
A stack is an ordered collection of data items in which an element may be inserted or
deleted at the same end.
33. What is top and base of a stack?
• The location where addition of new items and removal of existing items take place
is called top.
• The opposite of top is called base.
34. What is meant by LIFO?
In a stack, the element which is added last will be removed first.

This order is called LIFO(Last In First Out).


35. Explain memory representation of a stack using one dimensional array
Two methods: 1.Static representation using arrays.
2. Dynamic representation using Linked Lists.
1. Static representation using arrays.
• Stack can be represented using a one dimensional array.
• The stack items are stored in sequential order.
• A pointer TOP indicates the location of the top element.
• A variable N indicates the maximum number of elements tin the stack.
• If TOP=N-1, then stack is full.
• If TOP=NULL, then stack is empty.
2. Dynamic representation using Linked Lists
• In linked list, we can increase the size at run time by creating a new node.

II PUC COMPUTER SCIENCE 28


• In insertion operation, a new node is created.
• In deletion, top item must be deleted from the linked list.

36. Explain the different types of operations performed on stacks.


• stack( ): It creates a new stack that is empty
• push(item): It adds a new item to the top of the stack
• pop( ): It removes the top item from the stack
• peek( ): It returns the top item from the stack but does not remove it
• isEmpty( ): It tests whether the stack is empty
• size( ): It returns the number of items on the stack
37. What is push operation?
The process of adding one element or item to the stack is called PUSH operation.
38. Write an algorithm for push operation.
Step 1: if TOP = N-1 then
PRINT “STACK is Full”
Exit
End if
Step 2: TOP = TOP + 1
Step 3: STACK[TOP] = ITEM
Step 4: Return
39. What is pop operation?
The process of deleting one element from the stack is called popoperation.
40. Write an algorithm for pop operation?
Step 1: if TOP = NULL then
PRINT “STACK is Empty”
Exit
End if
Step 2: ITEM = STACK[TOP]
Step 3: TOP = TOP-1
Step 4: Return
41. Write the applications of stack.
• Reverse a word.
• Undo and Redo operations
• Runtime memory management
• Conversion of decimal number into binary.
• Quick sort.
42. Explain the types of arithmetic expression.
a. Infix expression- Operator is in between operands. Ex: a + b
b. Postfix expression – Operator follows two operands. Ex:ab+
c. Prefix expression – Operator precedes two operands. Ex: +ab
43. What is a queue?
A queue is an ordered collection of items where addition of new itemsand the removal of
existing items take place at different ends.
44. What is the other name of queue?
FIFO.

II PUC COMPUTER SCIENCE 29


45. What is meant by FIFO?
Queue is also called as FIFO (First InFirstOut). In a queue the elementwhich is inserted first
will be removed first.
46. What are rear and front?
REAR – The end where insertions take place in a queue is called rear.
FRONT – The end where deletions take place in a queue is called front.
47. Explain the different types of queues.

FRONT REAR

A B C D E

0 1 2 3 4 5 6 7 8

Simple Queue: In a simple queue insertion occurs at the rear end and
deletion occurs at the front end of the list.
Here FRONT = 1, REAR = 5
Circular Queue: A circular queue is a queue in which all nodes aretreated as circular such
that the last node follows the first node.

FRONT= 0
REAR = 4
Priority Queue: A priority queue is a queue that contains items thathave some certain
priority. An element can be inserted or removed from any position depending upon some
priority.
Dequeue (Double Ended Queue): It is a queue in which insertion and
deletion takes place at both the ends.
Insertion Insertion

Deletion Deletion
48. Explain the different operations on queue.
• Queue( ) – It creates a new queue that is empty.
• enqueue(item) – It adds a new item to the rear of the queue.
• dequeue( ) – It removes the front item from the queue.

II PUC COMPUTER SCIENCE 30


• isEmpty( ) – It tests whether the queue is empty.
• size( ) – It returns the number of items in the queue.
49. Explain the memory representation of a queue using array.
• Queue can be represented in memory using arrays.
• The pointer FRONT indicates the location of the first element.
• The pointer REAR indicates the location of the last element.
• If REAR = N – 1 then the queue is full.
• If FRONT = NULL, then the queue is empty.
50. Write an algorithm to insert an element in a queue.
Step 1: If REAR = N – 1 then
PRINT “Overflow”
Exit
End if
Step 2: If FRONT = NULL then
FRONT = 0
REAR = 0
Else
REAR = REAR + 1
End if
Step 3: Queue [REAR] = ITEM
Step 4: Return
51. Write an algorithm to delete an element in a queue.
Step 1: If FRONT = NULL then
PRINT “Underflow”
Exit
End if
Step 2: ITEM = QUEUE [FRONT]
Step 3: If FRONT = REAR then
FRONT = 0
REAR = 0
Else
FRONT = FRONT+ 1
End if
Step 4: Return
52. What are the applications of queues?
• Various features of Operating system.
• Multi-programming platform systems.
• Different types of scheduling algorithms.
• Various application softwares
• Printer server routines.
53. What is a linked list?
Linked list is a collection of data elements called nodes.
54. Name the two parts of a linked list.
• Data field or information field
• Link field

II PUC COMPUTER SCIENCE 31


55. Explain the different types of linked list.
Singly Linked List –
• A singly linked list contains two fields in each node – anInformation field and the link
field.
• The information field contains the data of that node.
• The link field contains the memory address of the next node.
• Since there is only one link field in each node, the linked list iscalled singly linked list.

START

10 20 30

NODE 1 NODE 2 NODE 3


Circular Linked List -
• In a circular linked list, the link field of the last node containsthe memory address of the
first node.

10 20 30

Doubly Linked List –


• It is a linked list in which each node points both to the nextnode and previous node.
• In a doubly linked list, each node contains 3 parts. FORW, BACKand INFO
• FORW: It is a pointer field that contains the address of the nextnode.
• BACK: It is a pointer field that contains the address of theprevious node.
• INFO: It contains the actual data.

START

null 10 20 30 null

56. What are the operations on linked lists?


• Creating a linked list
• Traversing a linked list
• Inserting an item into a linked list
• Deleting an item from a linked list
• Searching an item in a linked list
• Merging two or more linked lists to form a single list
57. What is garbage collection?

II PUC COMPUTER SCIENCE 32


The operating system of the computer periodically collects all thedeleted space into the
free-storage list. This technique is called as garbagecollection.
58. What is a tree?
A tree is a data structure consisting of nodes organized as a hierarchy.
59. Define: -
Root Node – The top most node in a tree is called the root node.
Node – Each element of a tree is called node.
Parent Node (ancestor node) – A node that has a child is calledparent node.
Edge – It connects two nodes to show that tree has a relationshipbetween them.
Leaf Node – Nodes that do not have any child are called leaf node.
Height – The height of a node is number of nodes traversal from theroot node to the
leaf node.
Depth – The depth of a node is a length of the path to its root.
Subtree – Subtree of a tree is a tree consisting of a node and all of itschildren.
Binary tree – A binary tree is a tree in which each node has maximumtwo children.
60. What is a graph?
A graph is a collection of nodes called vertices, which are connected byedges.

II PUC COMPUTER SCIENCE 33

You might also like