Computer Science cheat sheet
13 chapters. In each, the formulas come first, then the key facts. The number beside a line is the NCERT page it is printed on.
13 chapters · 35 formulas · 514 key facts
- 1Start hereException Handling in PythonComputer Science · 43 key factsRead
- 2File Handling in PythonComputer Science · 37 key factsRead
- 3StackComputer Science · 34 key factsRead
- 4QueueComputer Science · 39 key factsRead
- 5SortingComputer Science · 10 formulas · 39 key factsRead
- 6SearchingComputer Science · 10 formulas · 41 key factsRead
- 7Understanding DataComputer Science · 3 formulas · 41 key factsRead
- 8Database ConceptsComputer Science · 38 key factsRead
- 9Structured Query Language (SQL)Computer Science · 3 formulas · 41 key factsRead
- 10Computer NetworksComputer Science · 1 formula · 40 key factsRead
- 11Data CommunicationComputer Science · 8 formulas · 41 key factsRead
- 12Security AspectsComputer Science · 41 key factsRead
- 13Project Based LearningComputer Science · 39 key factsRead
Exception Handling in Python
6 topics · 43 facts
- 1Syntax Errors
- 2Exceptions
- 3Built-in Exceptions
- 4Raising Exceptions
- 5Handling Exceptions
- 6Finally Clause
Syntax errors, also known as parsing errors, are detected when the code violates the grammatical rules of the Python language.
p.1When a syntax error is encountered, the Python interpreter stops and will not execute the program until the error is rectified, saved, and rerun.
p.1In script mode, encountering a syntax error causes Python to display an error dialog box specifying the error name and a description.
p.2An exception is a Python object that represents an error occurring during execution even when statements are syntactically correct.
p.3When an error occurs during program execution, an exception is raised, disrupting normal flow unless handled by the programmer.
p.3SyntaxError is handled as an exception, but all other exceptions are raised only when the program code is syntactically valid.
p.3Built-in exceptions are predefined error classes in Python that execute standard exception handlers displaying the error name and reason.
p.3ValueError is raised when a function receives an argument of the correct data type but an inappropriate or mismatched value.
p.3IOError is raised when a file-related operation fails, such as when a specified file cannot be opened.
p.3KeyboardInterrupt is raised when the user interrupts normal program execution by pressing keys such as Delete or Esc.
p.4ImportError is raised when the Python interpreter cannot find the definition of a requested module in the import statement.
p.4EOFError is raised when the end-of-file condition is reached without reading any input data from the input() function.
p.4ZeroDivisionError is raised when the denominator or second operand in a division or modulo operation evaluates to zero.
p.4IndexError is raised when attempting to access a sequence subscript or index that is out of range.
p.4NameError is raised when an identifier name is referenced in local or global scope but has not been defined.
p.4TypeError is raised when an operator or function is applied to an operand or argument of an incorrect data type.
p.4IndentationError is raised for improper code indentation, and OverFlowError is raised when a numeric calculation exceeds its limit.
p.4Programmers can define custom exception classes to meet specific program needs, which are referred to as user-defined exceptions.
p.4Each time an error is detected during program execution, the Python interpreter raises or throws an exception object.
p.4The raise statement allows programmers to forcefully trigger either a built-in exception or a user-defined exception.
p.5The syntax of the raise statement is raise exception-name[(optional argument)], where the argument is typically an error message string.
p.5Once an exception is raised, execution of the current code block halts immediately, and control jumps directly to an exception handler.
p.5Python displays a stack traceback showing the sequence of nested function calls leading up to where an unhandled exception occurred.
p.6The assert statement tests an expression and raises an AssertionError if that test expression evaluates to false.
p.6The syntax assert Expression[,arguments] allows passing an optional expression or string that is displayed when AssertionError is raised.
p.6An assert statement is generally placed at the beginning of a function or after a function call to validate input arguments.
p.6Exception handling prevents programs from crashing abruptly by catching runtime errors and providing proper instructions to the user.
p.7Exception handlers separate core application logic from error detection and handling code into distinct blocks.
p.8When an error occurs, Python creates an exception object containing error information and hands it to the runtime system, termed throwing.
p.8The runtime system searches methods in the call stack in reverse hierarchical order until it finds a matching exception handler.
p.8Catching an exception is the process in which the runtime system successfully finds and executes an appropriate exception handler.
p.9Suspicious lines of code that might trigger an exception are placed inside a try block, which must be followed by an except block.
p.10When an exception occurs in a try block, subsequent try statements are abandoned and control jumps to the matching except block.
p.10If no exception occurs during the execution of the try block, all associated except blocks are skipped.
p.10A single try block can have multiple except blocks to handle different exception types separately.
p.11Python searches multiple except blocks sequentially and executes only the first handler that matches the raised exception.
p.12A bare except clause without any specified exception name catches any remaining exception and must be placed as the last except block.
p.12The optional else clause placed after all except blocks executes only when no exception is raised inside the try block.
p.13Statements inside the finally block always execute irrespective of whether an exception occurred in the try block or was handled.
p.13If present, the finally block must always be placed at the very end of the try construct, after all except blocks and the else clause.
p.13The finally block is commonly used when working with files or external connections to guarantee that file objects are safely closed.
p.13If an exception is raised in a try block and not handled by any except clause, the finally block executes first before the exception is re-raised.
p.14Unlike an except block, executing a finally block does not terminate an unhandled exception, which continues propagating up the call stack.
p.15
File Handling in Python
8 topics · 37 facts
- 1Introduction to Files
- 2Types of Files
- 3Opening and Closing a Text File
- 4Writing to a Text File
- 5Reading from a Text File
- 6Setting Offsets in a File
- 7Creating and Traversing a Text File
- 8The Pickle Module
Variables created in a program have a lifetime limited to program execution, requiring files on secondary storage devices to store input and generated output permanently for reusability.
p.19Python programs and data can be stored permanently on secondary storage devices as named files so that information can be retrieved and reused in future sessions.
p.19A text file stores a sequence of characters where each character is translated from its ASCII or UNICODE value into human-readable text by an editor.
p.20Each line of a text file is terminated by a special End of Line (EOL) character, which in Python is the newline character by default.
p.20Binary files store actual content like images, audio, video, or executables directly as a sequence of bytes rather than character ASCII values.
p.21Binary files are not human-readable, so attempting to open a binary file in a standard text editor displays meaningless garbage characters.
p.21In a binary file, even a single bit change can corrupt the file and make it completely unreadable to the supporting application.
p.21The open() function returns a file object or file handle that establishes a link between the Python program and the data file stored on secondary storage.
p.21The file object attributes closed, mode, and name return a boolean indicating whether the file is closed, its opening access mode string, and its filename, respectively.
p.21The access_mode argument in open() is optional and defaults to "r" (read-only in text mode), which positions the initial file offset at the beginning of the file.
p.22Opening a file in write mode "w" creates a new empty file if it does not exist, or erases and overwrites all existing contents if the file already exists.
p.22Opening a file in append mode "a" positions the file pointer at the end of the file so that newly written data is appended after existing data.
p.22The close() method frees the system resources allocated to a file and ensures that any unwritten buffered data is flushed to permanent storage.
p.23Opening a file using the with clause ensures that Python automatically closes the file upon exiting the block, even if an unhandled exception occurs.
p.23The write() method takes a single string as an argument, writes it onto the file buffer, and returns the number of characters written.
p.24The write() method does not add a newline automatically, requiring explicit inclusion of a newline character at the end of each line.
p.24Numeric data must be converted into string format using str() before it can be written to a text file using the write() method.
p.24The writelines() method writes an iterable sequence of strings to a file without returning the character count and without inserting newlines.
p.24The flush() method forcefully clears the write buffer and writes all pending buffered contents to the permanent storage file before closing.
p.24Before reading from a file, it must be opened in a valid read mode such as "r", "r+", "w+", or "a+".
p.25The read(n) method reads at most n bytes or characters from a file; if n is omitted or negative, it reads the entire remaining file contents as a single string.
p.25The readline([n]) method reads one complete line up to the newline character, or reads up to n characters if n is specified and smaller than the line.
p.26Both read() and readline() return an empty string when the file pointer reaches the end of the file (EOF).
p.26The readlines() method reads all remaining lines from the file and returns them as a list of strings, where each element terminates with a newline character.
p.26Iterating directly over a file object using a for loop traverses the file line by line until the end of the file is reached.
p.27The tell() method returns an integer representing the current byte position of the file object from the beginning of the file.
p.28The seek(offset, reference_point) method moves the file object by offset bytes relative to reference_point: 0 (beginning), 1 (current), or 2 (end of file).
p.28The reference_point parameter in the seek() method defaults to 0, which means the offset is counted from the beginning of the file.
p.28Opening a text file in "w+" mode allows both reading and writing with a single file object, but it truncates all existing file contents upon opening.
p.29A text file can be traversed line by line using a while loop where readline() is called repeatedly until it returns an empty string at EOF.
p.30When reading and writing using a single file object in "w+" mode, calling seek(0) is required to reposition the file pointer to the beginning before reading back data.
p.31The pickle module is used for serializing and deserializing Python object structures such as lists, tuples, and dictionaries to and from binary files.
p.32Serialization (pickling) transforms a Python object in memory into a byte stream, while deserialization (unpickling) converts a byte stream back into the original object.
p.32The pickle.dump(data_object, file_object) function writes a serialized Python object to a binary file opened in write binary "wb" or append binary "ab" mode.
p.32The pickle.load(file_object) function reads a serialized byte stream from a binary file opened in read binary "rb" mode and reconstructs the original Python object.
p.33Reading pickled objects sequentially using pickle.load() inside an infinite loop raises an EOFError exception when the end of the binary file is reached.
p.34An EOFError exception raised by pickle.load() must be handled using a try-except block to safely detect the end of the binary file without crashing the program.
p.35
Stack
6 topics · 34 facts
- 1Stack
- 2Operations on Stack
- 3Implementation of Stack in Python
- 4Notations for Arithmetic Expressions
- 5Conversion from Infix to Postfix Notation
- 6Evaluation of Postfix Expression
A stack is a linear data structure in which elements are arranged in a sequence, and insertion and deletion of elements take place at the same end called the TOP of the stack.
p.40A stack operates on the Last-In-First-Out (LIFO) principle, where the most recently inserted element is always the first one to be removed.
p.40Reversing a string is performed using a stack by pushing all characters into the stack and then popping them out, resulting in the reverse order of their appearance.
p.41Text and image editors use a stack to implement undo and redo features by keeping track of editing changes so the most recent edit can be undone or redone first.
p.41Web browsers maintain the history of visited URLs in a stack to enable navigation back to the most recently visited web pages using the BACK button.
p.41Compilers and interpreters use a stack to check for matched and properly nested parentheses in arithmetic expressions, raising an error if parentheses are mismatched.
p.41The PUSH operation adds a new element at the TOP of the stack as an insertion operation.
p.42Attempting to add or push a new element onto a full stack results in an exception called overflow.
p.42The POP operation removes and returns the topmost element from the TOP of the stack as a deletion operation.
p.42Attempting to delete or pop an element from an empty stack results in an exception condition called underflow.
p.42In a stack of elements, both PUSH and POP operations are strictly performed from the same end, known as the TOP of the stack.
p.42In Python, a stack is commonly implemented using a list, where the built-in append() method pushes an element to the rightmost end and pop() deletes from that end.
p.43Because Python list methods append() and pop() operate on the rightmost end of the list, an explicit declaration or pointer variable for TOP is not required.
p.43An isEmpty() helper function determines whether a stack is empty by checking if len(stack) == 0, returning True if empty and False otherwise.
p.43Because Python lists have no fixed size limit, a list-implemented stack never faces an overflow condition unless host system memory is completely exhausted.
p.44The most recent element at the TOP of a Python list stack of length x is read at index x - 1 without removing it.
p.44Before popping an element, the pop operation must verify that the stack is not empty to avoid an underflow condition.
p.44To display stack elements from TOP to bottom, the list is traversed in reverse order using range(len(stack) - 1, -1, -1).
p.45In infix notation, binary operators are placed in between their operands and parentheses are required to override standard operator precedence.
p.46Polish notation, also known as prefix notation, places operators before their corresponding operands, eliminating the need for parentheses.
p.46Reverse Polish notation, also called postfix notation, places operators after their corresponding operands.
p.46In prefix and postfix notations, the relative positions of operators and operands completely determine the order of evaluation without requiring parentheses.
p.46An infix expression x + y is written as +xy in prefix notation and as xy+ in postfix notation.
p.46Prefix and postfix expressions require only a single left-to-right traversal for evaluation because operators are already positioned according to evaluation order.
p.47During the conversion of an infix expression to postfix notation, a stack is used to hold operators while operands are appended directly to the output string.
p.47In infix to postfix conversion, encountering an incoming left parenthesis causes it to be pushed directly onto the stack.
p.48When an incoming right parenthesis is encountered during infix to postfix conversion, operators are popped and appended to the output until the matching left parenthesis is popped and discarded.
p.48When an incoming operator has lower precedence than the operator at the top of the stack, operators are popped from the stack and appended to the output until a lower precedence operator is found.
p.48After processing all characters of the infix expression, any remaining operators on the stack are popped and appended to the postfix output string until the stack is empty.
p.48When evaluating a postfix expression using a stack, operands are pushed onto the stack, whereas operators trigger popping and computation.
p.49When an operator is encountered during postfix evaluation, two operands are popped from the stack, the operation is applied, and the computed result is pushed back onto the stack.
p.49Upon reaching the end of a valid postfix expression, the stack contains exactly one element, which is popped as the final evaluated result.
p.50If the stack does not contain exactly one element at the end of postfix expression evaluation, the expression is declared an invalid postfix expression.
p.50During postfix expression evaluation using a stack, only operands and intermediate computed numerical values are pushed onto the stack.
p.51
Queue
5 topics · 39 facts
- 1Introduction to Queue
- 2Operations on Queue
- 3Implementation of Queue using Python
- 4Introduction to Deque
- 5Implementation of Deque Using Python
A queue is an ordered linear data structure of elements that operates on the First-In-First-Out (FIFO) principle, unlike a stack which operates on Last-In-First-Out (LIFO).
p.53A queue has different ends for adding and removing elements, ensuring that elements leave in the order they arrived.
p.53The First-In-First-Out (FIFO) principle ensures that the element entering the queue first is the first one removed, which is also known as the First Come First Served (FCFS) approach.
p.54In a queue, new items always get added at one end called the REAR (or TAIL), and items always get removed from the other end called the FRONT (or HEAD).
p.54Real-life applications of queues include train reservation waiting lists, customer service IVRS call queues, single-lane roads, and highway toll booths.
p.54In computer science, a queue is used by web servers to handle concurrent user requests beyond immediate processing capacity.
p.55In a multitasking operating system, CPU jobs are queued and given access to the processor on a FIFO basis according to the order of arrival.
p.55Operating systems put print commands from multiple files or computers into a queue and send them to a shared printer one by one on a FIFO basis.
p.55The ENQUEUE operation is used to insert a new element into the queue at the rear end.
p.55Inserting elements beyond the maximum capacity of a queue results in an exception known as Overflow.
p.55The DEQUEUE operation is used to remove one element at a time from the front of the queue.
p.55Attempting to delete an element from an empty queue results in an exception known as Underflow.
p.55The IS EMPTY operation checks whether the queue has any elements so as to avoid an Underflow exception while performing a dequeue operation.
p.55The PEEK operation is used to view the element at the front of the queue without removing it from the queue.
p.56The IS FULL operation checks whether any more elements can be added to the queue to avoid an Overflow exception while performing enqueue.
p.56When using a list to implement a queue, either index 0 or index n-1 can be fixed as Front, with the opposite end fixed as Rear.
p.56A queue can be created in Python by initializing an empty list using the statement myQueue = list().
p.56In a Python list implementation with Front at index 0, enqueue is implemented using myQueue.append(element), which always adds the element at the rear.
p.56Python does not require fixed-size list creation, so a dynamic list-based queue never encounters an Overflow condition or requires Is Full.
p.56The isEmpty(myQueue) function checks queue emptiness by testing len(myQueue) == 0, returning True if empty and False otherwise.
p.57The dequeue(myQueue) function deletes and returns the front element using myQueue.pop(0) after checking that the queue is not empty.
p.57The size(myQueue) function uses Python len(myQueue) to return the total number of elements present in the queue.
p.57The peek(myQueue) function returns the front element at myQueue[0] if the queue is not empty, and returns None if the queue is empty.
p.57Calling dequeue on an empty queue when no elements remain produces an underflow condition.
p.58A deque (double-ended queue, pronounced deck) is a linear data structure in which addition and removal of elements can occur from either end (front or rear).
p.59Because a deque applies no restriction on the side for adding or removing elements, it can be used to implement either a stack or a queue.
p.59In a deque, if insertion and deletion of elements are performed from the same end, it behaves as a Stack.
p.60In a deque, if insertion and deletion of elements are performed from opposite ends, it behaves as a Queue.
p.60Browser history and text editor undo-redo features use deque properties to discard least visited URLs or manage state from the ends.
p.60The four primary operations on a deque are INSERTFRONT, INSERTREAR, DELETIONFRONT, and DELETIONREAR.
p.60In the palindrome-checking algorithm using a deque, characters removed from both front and rear must match in each step until empty or one character remains.
p.61A deque is an ordered linear list and can be implemented in Python using the built-in list data type.
p.61In Python, insertFront is implemented using myDeque.insert(0, element) to insert an element at the beginning of the list.
p.62In Python, insertRear is implemented using myDeque.append(element) to add an element to the end of the list.
p.62The deletionRear(myDeque) function removes and returns the last element of the deque using myDeque.pop() when the deque is not empty.
p.62The deletionFront(myDeque) function removes and returns the first element of the deque using myDeque.pop(0) when the deque is not empty.
p.62The getFront(myDeque) function reads the value at myDeque[0] without removing it, returning a copy when the deque is not empty.
p.62The getRear(myDeque) function reads the value at myDeque[len(myDeque)-1] without removing it when the deque is not empty.
p.63Calling deletionFront, deletionRear, getFront, or getRear on an empty deque triggers an underflow condition and returns None when guarded.
p.64
Sorting
4 topics · 10 formulas · 39 facts
- 1Bubble Sort
- 2Selection Sort
- 3Insertion Sort
- 4Time Complexity of Algorithms
- Total number of passes in bubble sortp.68
- Inner loop comparison upper bound in bubble sort pass ip.70
- Total number of passes in selection sortp.71
- Starting comparison index of unsorted sublist in selection sortp.73
- Size of unsorted sublist after first pass in insertion sortp.74
- Starting backward comparison index in insertion sortp.76
- Time complexity of constant time algorithm without loopp.78
- Time complexity of linear time algorithm with single loopp.78
- Time complexity of quadratic time algorithm with nested loopp.78
- Time complexity of bubble, selection, and insertion sort algorithmsp.78
Sorting is the process of ordering or arranging a given collection of elements in a particular order, such as ascending or descending numerical order.
p.67Strings can be sorted in alphabetical order from a to z or z to a, or according to the length of the string.
p.67The additional execution time required to sort a large number of items is known as overhead.
p.68Bubble sort sorts a list of elements by repeatedly comparing adjacent elements and swapping them if they are unordered.
p.68Swapping two elements in an algorithm means interchanging their positions with each other.
p.68Every single iteration through each element of a list in a sorting algorithm is called a pass.
p.68For a list containing n elements, bubble sort makes a total of n - 1 passes to sort the entire list.
p.68In ascending bubble sort, the largest unsorted element is identified after each pass and bubbled up to its correct position at the end of the list.
p.68Sorted elements placed in their correct positions after each pass of bubble sort are excluded from comparisons in remaining passes.
p.68If no swapping occurs during a pass in bubble sort, the list is already sorted and the sorting operation can be stopped.
p.68In the Python implementation of bubble sort, adjacent elements are swapped using simultaneous assignment list1[j], list1[j+1] = list1[j+1], list1[j].
p.70The inner loop of bubble sort runs up to index n - i - 1 because the last i elements are already sorted from previous passes.
p.70To sort a list of n elements, selection sort makes a total of n - 1 passes through the list.
p.71Selection sort conceptually divides the list into two parts: a left sublist of sorted elements and a right sublist of unsorted elements.
p.71Initially in selection sort, the left sorted sublist is empty while the right unsorted sublist contains all n elements.
p.71In each pass of ascending selection sort, the unsorted sublist is traversed to find the smallest element, which is then swapped with the leftmost unsorted element.
p.71Once moved to the sorted sublist in selection sort, an element is not considered in further passes, reducing the unsorted sublist by one.
p.71After n - 1 passes in selection sort place the n - 1 smallest elements, the nth element is already in place and requires no further swap.
p.71In the selection sort algorithm, variable min is initialized to the pass index i to hold the index of the smallest element found so far.
p.73Selection sort uses a flag variable set to 1 when a smaller element is detected to decide whether to perform a swap after the inner loop.
p.73The inner loop of selection sort compares elements from index j = i + 1 to the end of the list because elements before index i are already sorted.
p.73Like selection sort, insertion sort divides the list into two parts: a sorted sublist and an unsorted sublist.
p.74In insertion sort, each element from the unsorted sublist is considered one by one and inserted into its appropriate position in the sorted sublist.
p.74In each pass of insertion sort, the sorted sublist is traversed in backward direction to locate the appropriate position for the unsorted element.
p.74In pass 1 of insertion sort, the sorted sublist contains a single element while the unsorted sublist contains n - 1 elements.
p.74When an unsorted element is smaller than a sorted element, the sorted element is shifted to the right to make space for insertion.
p.74Shifting a sorted element rightward in pass 1 makes the sorted sublist size 2 and reduces the unsorted sublist size to n - 2.
p.74In the insertion sort algorithm, the outer loop index i begins at 1 because a single element at index 0 is already considered sorted.
p.76The unsorted element being positioned in insertion sort is stored in a temporary variable temp before shifting existing elements rightward.
p.76The while loop in insertion sort continues shifting elements rightward as long as j >= 0 and numList[j] is greater than temp.
p.76Once the correct position is reached in insertion sort, temp is placed at numList[j+1] to complete the insertion.
p.76The amount of time an algorithm takes to process a given data set is defined as its time complexity.
p.77Analyzing time complexity determines how a sorting algorithm behaves when input order changes or when the list size increases or decreases.
p.77Any algorithm that contains no loops has a time complexity of 1 because the number of executed instructions is constant regardless of data size.
p.78Algorithms that execute a constant number of instructions irrespective of data size are known as constant time algorithms.
p.78An algorithm containing a single loop executing n times has a time complexity of n and is known as a linear time algorithm.
p.78A loop within a loop has a time complexity of n^2 and algorithms with this structure are known as quadratic time algorithms.
p.78If an algorithm contains both a nested loop and a single loop, its time complexity is estimated on the basis of the nested loop only.
p.78Bubble sort, selection sort, and insertion sort all contain nested loops and therefore each has a time complexity of n^2.
p.78
Searching
3 topics · 10 formulas · 41 facts
- 1Linear Search
- 2Binary Search
- 3Search by Hashing
- Minimum comparisons in linear searchp.83
- Maximum comparisons in linear searchp.83
- Element position from index in linear searchp.82
- Initial search bounds in binary searchp.87
- Middle index calculation in binary searchp.87
- Upper bound update in binary searchp.87
- Lower bound update in binary searchp.87
- Minimum iterations in binary searchp.87
- Element position from mid index in binary searchp.87
- Hash function by remainder methodp.90
Searching means locating a particular element in a collection of elements, determining whether it is present and finding its position if present.
p.81Linear search is an exhaustive searching technique where every element of a given list is compared one by one with the search key.
p.82In linear search, item by item comparison begins at the first element of the list and proceeds sequentially towards the last element.
p.82Linear search is also referred to as sequential search or serial search.
p.82Linear search is particularly suitable for collections of items that are unordered and small in size.
p.82In linear search, the search is declared successful as soon as an element matching the key is found.
p.82If the search key matches the first element in the list, linear search requires only 1 comparison, which is the minimum work.
p.83If the search key is the last element in the list, linear search must make n comparisons, which is the maximum work.
p.83If the key is not present in the list, linear search traverses the entire list and performs n comparisons to confirm absence.
p.84In Python, the linear search function returns index + 1 as the position when the key is found, and returns None if the key is absent.
p.84The time taken by linear search increases as the size of the list increases, making it slow and time-consuming for large lists.
p.93Binary search is an efficient search technique that makes use of the ordering of elements in a sorted list to locate a key.
p.85Binary search requires the input list to be arranged in order, such as ascending or descending order for numbers, or alphabetically for text.
p.85In binary search, the search key is compared directly with the element at the middle position of the sorted list.
p.85Comparing the key with the middle element produces three possibilities: match, key is smaller than mid element, or key is greater.
p.85If the middle element is greater than the key, the key must be in the first half, allowing the second half of the list to be ignored.
p.86If the middle element is less than the key, the key must be in the second half, allowing the first half of the list to be ignored.
p.86In binary search, the term iteration is used because after each unsuccessful comparison, the search area is redefined by updating first, mid, and last.
p.86Binary search continues splitting and halving the list size until the key is found or the remaining sublist contains only one item.
p.86If a list has an even number of elements, the middle index is calculated using Python's floor division operator (//).
p.86Each unsuccessful comparison in binary search reduces the number of elements remaining to be searched by half.
p.86Binary search does not alter the list itself; it only updates the index pointers to halve the search area in each iteration.
p.87In binary search, the loop repeats as long as the condition first <= last remains True.
p.87When the key being searched is at the middle position, binary search requires only 1 iteration, which is the minimum work.
p.87If numList[mid] is greater than the key, the upper search boundary pointer last is updated to mid - 1.
p.87If numList[mid] is less than the key, the lower search boundary pointer first is updated to mid + 1.
p.87The maximum work in binary search is required when the algorithm must narrow down the list to a single element to find the key or declare it absent.
p.88In Python implementation of binary search, the function returns the index mid if found, and returns -1 if the key is absent.
p.89Binary search applications include searching dictionaries, searching telephone directories, and finding the minimum or maximum element in a sorted list.
p.90Modified binary search techniques are applied in database indexing, routing tables in routers, and data compression code.
p.90Hashing is a search technique that enables determining the presence of a key in a list in just one step using a single comparison.
p.90A hash function takes elements of a list one by one and computes an integer index value for every element.
p.90A hash table is a list where each slot can hold only one item and positions are indexed by integers starting from 0.
p.90The size of a hash table can be larger than the number of elements in the original list.
p.90The remainder method is a hash function that divides an element by the hash table size and uses the remainder as the hash value.
p.90In hash-based searching, the time required to search for a key is constant and independent of the total size of the list.
p.91A collision occurs in hashing when two or more distinct elements produce the same hash value and map to the same slot in the hash table.
p.92Collision resolution is the process of finding an alternate slot in the hash table for subsequent items when a collision occurs.
p.92A perfect hash function maps every item of the list to a unique index in the hash table, ensuring that collisions never occur.
p.93Hash functions can be constructed using techniques such as modulo division, integer division, shift folding, boundary folding, mid-square, extraction, and radix transformation.
p.93The computational cost of evaluating a hash function must be small enough to make hashing-based searching faster than other search methods.
p.93
Understanding Data
5 topics · 3 formulas · 41 facts
- 1Introduction to Data
- 2Data Collection
- 3Data Storage
- 4Data Processing
- 5Statistical Techniques for Data Processing
- Arithmetic mean of a datasetp.104
- Range of a datasetp.106
- Standard deviation of a datasetp.106
Governments systematically collect and record data about the population through census, which provides valuable information for planning and formulating public policies.
p.97Data is a collection of characters, numbers, and other symbols that represents values of some situations or variables.
p.98The word data is plural and the singular form of the word data is datum.
p.98A knowledge base is a store of information consisting of facts, assumptions, and rules which an artificial intelligence system can use for decision making.
p.98Computers store data in electronic forms because automated data processing is significantly faster and easier compared to manual data processing done by people.
p.98Processing large volumes of data with computers reveals hidden patterns and traits that are otherwise not visible to humans.
p.98Dynamic pricing used by airlines, railways, and cab booking applications adjusts prices based on the relationship between demand and supply.
p.99Data can be classified on the basis of format into two broad categories: structured data and unstructured data.
p.99Structured data is organized data recorded in a well-defined format, usually stored in computers in a tabular format of rows and columns.
p.99In structured tabular data, each column represents a particular parameter called an attribute, characteristic, or variable, and each row represents an observation across those attributes.
p.100Unstructured data refers to data that does not follow a fixed pattern or traditional row-and-column tabular structure, such as newspapers, emails, and web pages.
p.100Metadata is defined as data about data and is used to describe unstructured data, such as subject, recipient, and attachments in an email, or file size and resolution in an image.
p.101Data collection involves identifying already available data or gathering data from appropriate sources before it can be stored and processed.
p.101Data recorded manually in diaries or registers must be entered into a digital format, such as a spreadsheet, prior to processing.
p.101Data can be gathered from pre-existing digital files such as comma-separated values (CSV) files or retrieved from a database management system like MySQL using software.
p.101Organizations collect transactional and observational data from digital interactions to improve customer services, analyze public opinion, and forecast economic parameters.
p.102Data storage is the process of storing gathered and processed data on digital storage devices so that the data can be retrieved for future use rather than discarded.
p.102Common digital storage devices used for saving data files include Hard Disk Drives (HDD), Solid State Drives (SSD), CD/DVD, tape drives, pen drives, and memory cards.
p.102File processing on operating systems has inherent limitations that can be overcome by using a Database Management System (DBMS).
p.102Data processing is the process of converting unorganized raw data into meaningful results and structured information, such as tables, charts, or text, for decision making.
p.102The data process cycle consists of three basic stages: input (data collection, preparation, entry), processing (store, retrieve, classify, update), and output (reports, results).
p.103Automated data processing systems verify input details for correctness and eligibility before generating output documents such as examination admit cards or travel tickets.
p.103A measure of central tendency is a single value that summarizes a dataset to give an overall idea about the data, such as its average, middle value, or frequency.
p.104The three most common measures of central tendency are the mean, median, and mode.
p.104Mean is the arithmetic average of numeric values of an attribute, computed by dividing the sum of all observations by the total number of observations.
p.104Mean is sensitive to extreme values, so outliers should be identified and removed from the data before computing the average of the remaining data.
p.104An outlier is an exceptionally large or small value in comparison to other values of the data, usually considered an error because it distorts statistical calculations.
p.104Median is computed for an attribute by sorting all values in ascending or descending order and identifying the middle value.
p.104When a dataset contains an odd number of values, median is the value at the middle position; when it contains an even number of values, median is the average of the two middle values.
p.105Median represents the actual central value at which the given dataset is equally divided into two parts, and it is less sensitive to outliers than mean.
p.105Mode is the value that appears the most number of times in the data of an attribute, computed on the basis of the frequency of occurrence of distinct values.
p.105Mode can be calculated for both numeric and non-numeric data, unlike mean and range which are restricted to numerical data.
p.105A dataset has no mode if every value occurs only once, and can have multiple modes if more than one distinct value shares the highest frequency.
p.105Measures of variability, also called measures of dispersion, indicate the spread, variation, or degree of diversity of values around the mean.
p.105Two different datasets can have the same mean, median, or mode but completely different levels of dispersion.
p.105Range is the difference between the maximum and minimum values of numerical data, indicating the total coverage or spread of data values.
p.105Because range is calculated using only two extreme values, any outlier in the dataset heavily influences and distorts the result.
p.106Standard deviation measures differences within a dataset and indicates the spread of data by considering every observation rather than only the two extreme values.
p.106Standard deviation is calculated as the positive square root of the average of squared differences of each observation from the mean value of the data.
p.106A smaller standard deviation indicates that data values are closely clustered around the mean, while a larger standard deviation indicates greater spread.
p.106Programming tools like Python provide dedicated libraries that utilize statistical techniques for efficient processing and analysis of large volumes of data.
p.107
Database Concepts
4 topics · 38 facts
- 1File System
- 2Database Management System
- 3Relational Data Model
- 4Keys in a Relational Database
A computer file is a container stored on a storage device that holds data such as text, computer program code, or comma-separated values.
p.112Accessing file data through software requires developing custom computer application programs to search, retrieve, and display data from the files.
p.113File systems exhibit difficulty in access because files lack internal retrieval mechanisms, requiring developers to write new application programs whenever unforeseen access formats are needed.
p.114Data redundancy occurs when the same data is duplicated across multiple files in a file system, leading to excess storage consumption and increasing the risk of data inconsistency.
p.114Data inconsistency arises in a file system when redundant copies of the same data maintained in different files fail to match following partial or omitted updates.
p.114Data isolation in a file system occurs because separate data files lack mapping or linking relationships, forcing users to write independent application programs to correlate data across multiple files.
p.114A database management system (DBMS) is software used to create, manage, store, update, and retrieve logically related data from a centralized database.
p.115A database system provides an abstract view of data by hiding physical storage and maintenance details from users and application programs.
p.116The DBMS serves as an interface between the physical database and end users or application programs, allowing data retrieval through queries.
p.116In a relational database, separate tables are linked or related through one or more common columns to eliminate unnecessary data duplication.
p.116When natural attributes can change or duplicate, an artificial unique column such as an identification number is created to relate tables unambiguously.
p.117A database schema is the skeleton design or logical architecture that defines table structures, column data types, constraints, and relationships.
p.118Data constraints are restrictions defined on table columns during schema definition to ensure data accuracy, validity, and reliability.
p.119A database catalog or data dictionary stores metadata, which is data about data describing database schemas and integrity constraints.
p.119A database instance is the actual operational state or snapshot of a database containing populated data at any specific point in time.
p.119A database schema remains static while the database instance changes dynamically whenever data manipulation operations occur.
p.120Data manipulation in a database comprises three fundamental operations: insertion of new records, deletion of existing records, and update of stored values.
p.120A database engine is the underlying software component used by a DBMS to create databases and process queries for data retrieval and manipulation.
p.120Adopting a DBMS increases system complexity and data vulnerability because centralizing data increases the risk of loss from hardware or software failure.
p.120A data model describes the logical structure of a database, including how data are defined, relationships among data items, and constraints enforced on data.
p.120In the relational data model, tables are called relations, and relations are linked together through common attributes to enable valid data retrieval.
p.121An attribute is a named characteristic or column of a relation that stores data values for a specific field across all tuples.
p.122A tuple is a single row of data in a relation that represents a collection of related attribute values for a real-world entity.
p.122A domain is the set of permissible values from which an attribute can take its value in each row, specified by an underlying data type.
p.122The degree of a relation is the total number of attributes or columns it contains.
p.122The cardinality of a relation is the total number of tuples or rows it contains.
p.123Property 1 of a relation establishes that each attribute must have a unique name within the relation and the sequence of attributes is immaterial.
p.123Property 2 of a relation requires that each tuple is distinct and uniquely identifiable, and the ordering or sequence of tuples is immaterial.
p.123Property 3 of a relation dictates that all values in an attribute must be atomic, come from the same domain, and single-valued in each tuple.
p.123The special value NULL is used in a relation to indicate data values that are missing, unknown, or not applicable for an attribute.
p.123A candidate key is an attribute or minimal set of attributes that takes distinct, non-null values and can uniquely identify each tuple in a relation.
p.124A primary key is the specific candidate key selected by the database designer to uniquely identify each tuple in a relation.
p.124An alternate key is any candidate key of a relation that was not chosen as the primary key by the database designer.
p.124A composite primary key consists of two or more attributes combined together to uniquely distinguish tuples when no single attribute is unique.
p.125A foreign key is an attribute in a referencing relation whose values are derived from and reference the primary key of another relation.
p.125The table containing the foreign key is known as the referencing or foreign relation, while the table defining the referenced primary key is the master relation.
p.125A foreign key attribute is permitted to take a NULL value as long as it does not form part of the primary key in the referencing relation.
p.125In schema diagrams, a foreign key is shown as a directed arrow originating from the referencing attribute and pointing to the referenced primary key.
p.125
Structured Query Language (SQL)
10 topics · 3 formulas · 41 facts
- 1Structured Query Language (SQL)
- 2Data Types and Constraints in MySQL
- 3SQL for Data Definition
- 4SQL for Data Manipulation
- 5SQL for Data Query
- 6Data Updation and Deletion
- 7Functions in SQL
- 8GROUP BY Clause in SQL
- 9Operations on Relations
- 10Using Two Relations in a Query
- Degree of Cartesian product of two relationsp.171
- Cardinality of Cartesian product of two relationsp.171
- Number of joins needed to combine N tablesp.175
SQL is a declarative language where the user specifies what data is to be retrieved rather than specifying how to retrieve it.
p.132SQL statements comprise descriptive English words, are not case-sensitive, and must terminate with a semicolon.
p.132The appearance of the mysql> prompt in the MySQL shell indicates that MySQL is ready to accept SQL statements.
p.132The CHAR(n) data type stores fixed-length character strings and right-pads with spaces up to n characters, whereas VARCHAR(n) allocates only the storage bytes needed for the entered string.
p.133An INT data type in MySQL occupies 4 bytes of storage and supports an unsigned integer range from 0 to 4,294,967,295.
p.133The DATE data type represents calendar dates in YYYY-MM-DD format and supports values ranging from 1000-01-01 to 9999-12-31.
p.133The NOT NULL constraint prevents an attribute from taking NULL values, where NULL represents a missing, unknown, or not applicable value.
p.134The PRIMARY KEY constraint uniquely identifies each record in a relation and does not allow any NULL or duplicate values.
p.134The number of attributes or columns defined in a table during table creation specifies the degree of that relation.
p.135The DESCRIBE or DESC statement displays the schema structure of a table, including its column names, data types, nullability, keys, and defaults.
p.137A foreign key attribute in a referencing table must match the data type and size of the corresponding primary key attribute in the referenced table.
p.138The ALTER TABLE statement modifies table schema by adding new columns, dropping attributes, altering constraints, or modifying column data types using the MODIFY clause.
p.139The DROP TABLE and DROP DATABASE statements permanently remove relations or whole databases from the system and cannot be undone.
p.141The INSERT INTO statement adds new records to a table, and column names may be omitted only when values are provided for all columns in their exact schema order.
p.141When populating records into a table having a foreign key, the referenced records in the parent relation must already be populated.
p.141Text and date literal values must always be enclosed in single quotes when inserting or querying records in SQL.
p.143A foreign key attribute can accept NULL values unless explicitly restricted with the NOT NULL constraint.
p.143The SELECT statement retrieves data from relations and outputs the result in tabular form, with the optional WHERE clause specifying filtering conditions.
p.144The DISTINCT clause in a SELECT query eliminates duplicate values from the output so that each value appears only once.
p.147The BETWEEN operator selects rows where an attribute value falls within a range inclusive of both specified boundary values.
p.150The IN operator tests for set membership by matching an attribute value against any value present in a specified list of values.
p.150NULL values cannot be compared using relational equality operators and must be evaluated using IS NULL or IS NOT NULL.
p.151The ORDER BY clause sorts query results in ascending order by default, and sorts in descending order when the DESC keyword is appended.
p.151In pattern matching with the LIKE operator, percent (%) represents zero or more characters and underscore (_) represents exactly one character.
p.152The UPDATE statement modifies values of existing records, and omitting its WHERE clause results in updating every record in the table.
p.154The DELETE statement removes specified records from a table, and omitting its WHERE clause deletes all tuples while preserving the table schema.
p.155Single-row or scalar functions operate on a single record at a time and return a single output value for each row evaluated.
p.158The ROUND(N, D) function rounds number N to D decimal places, rounding to the nearest integer when D is zero or omitted.
p.158Aggregate functions operate on a set of records as a whole and return a single summary value for each column evaluated.
p.165COUNT(*) counts all rows in a relation including those with NULL values, whereas COUNT(column) ignores NULL values in the specified column.
p.166The GROUP BY clause groups together rows that contain identical values in a specified column so that aggregate functions can work on each group.
p.167The HAVING clause places filtering conditions on the grouped rows produced by GROUP BY, whereas the WHERE clause filters individual rows before grouping.
p.167The relational operations UNION, INTERSECT, and MINUS require union compatibility, meaning participating relations must have the same degree and identical attribute domains.
p.169The UNION operation combines tuples from two relations and automatically eliminates duplicate rows from the resulting relation.
p.169The INTERSECT operation produces a relation containing only the common tuples present in both participating relations.
p.170The MINUS or set difference operation yields tuples that exist in the first relation but do not exist in the second relation.
p.170The Cartesian product operation pairs every row of the first relation with every row of the second relation regardless of common attribute values.
p.171When a table alias is declared in the FROM clause, it remains valid only for that query and the original table name cannot be used to qualify columns.
p.173The JOIN clause combines rows from two relations based on an explicit matching condition, typically matching a foreign key to a primary key.
p.173A NATURAL JOIN joins two tables on common attributes having the same name and data type, eliminating redundant join columns from the result.
p.174Combining N tables in an equi-join query requires at least N - 1 join conditions to avoid an unintended Cartesian product.
p.175
Computer Networks
8 topics · 1 formula · 40 facts
- 1Introduction to Computer Networks
- 2Evolution of Networking
- 3Types of Networks
- 4Network Devices
- 5Networking Topologies
- 6Identifying Nodes in a Network
- 7Internet, Web and the Internet of Things
- 8Domain Name System
- Number of wires in a fully-connected mesh topologyp.192
A computer network is an interconnection among two or more computers or computing devices that allows them to share data, hardware, and software resources.
p.182In a communication network, any device that can receive, create, store, or send data to different network routes is designated as a node.
p.182Data transmitted across a network is broken down into smaller chunks called packets, which travel across wired media such as cables or wireless media such as radio waves.
p.182ARPANET was commissioned in the 1960s by the U.S. Department of Defence to link academic and research institutions, communicating its first message between UCLA and SRI in 1969.
p.183Roy Tomlinson developed network email messaging in 1971, introducing the @ symbol to designate the host computer of a network user.
p.183TCP/IP was adopted as the standard protocol suite on ARPANET in 1983, following the coining of the term Internet and the launch of Telenet in 1974.
p.183Tim Berners-Lee at CERN developed HTML and URL in 1990, giving birth to the World Wide Web for sharing hyperlinked documents.
p.183A Personal Area Network (PAN) covers an approximate range of up to 10 metres, connecting personal devices either via wired USB or wireless technologies like Bluetooth.
p.184A Local Area Network (LAN) connects computing devices across a limited distance up to 1 km within a room, office, or campus, providing secure high-speed data transfer rates.
p.185Ethernet is a standard set of rules deciding how computers connect and communicate through cables in a Local Area Network, typically offering speeds between 10 Mbps and 1000 Mbps.
p.185A Metropolitan Area Network (MAN) is an extended form of LAN covering a city or town up to 30 to 40 km, commonly exemplified by cable television networks and cable-based broadband services.
p.186A Wide Area Network (WAN) connects computers, LANs, and MANs across different geographical locations, countries, or continents, with the Internet being the largest existing WAN.
p.186A modem performs modulation by converting a sender's digital data into analog signals for transmission, and demodulation by converting incoming analog signals back into digital bits.
p.187An Ethernet card, or Network Interface Card (NIC), is a hardware adaptor mounted on the motherboard that connects a computer to a wired network and contains a unique MAC address.
p.188An RJ45 (Registered Jack-45) is an eight-pin connector used exclusively with Ethernet cables to fit into the RJ-45 jacks of network interface cards.
p.188A repeater is an analog device that regenerates weakened electrical or optical signals over long transmission cables (typically beyond 100 metres) to restore signal strength.
p.189An Ethernet hub broadcasts all incoming data packets to every connected port, which can cause packet collisions when multiple devices transmit simultaneously.
p.189A network switch inspects the destination address of incoming packets, looks it up in an internal switching table, forwards traffic only to the designated port, and drops corrupted frames.
p.189A router connects a local area network to the Internet, analyzes incoming data packets, determines optimal transmission paths, and repackages data if traversing networks with different packet size limits.
p.190A gateway serves as the primary entry and exit point connecting an organisation's network to foreign networks, routing packets across different network paths and frequently integrating a firewall.
p.190Network topology defines the physical or logical arrangement of computers, cables, and other peripheral devices in a network.
p.191In a mesh topology, every communicating device connects directly to every other device, providing high fault tolerance and security because a failure in one link does not interrupt others.
p.192In a ring topology, each node connects to exactly two adjacent nodes forming a circular ring where data circulates unidirectionally, either clockwise or counterclockwise.
p.192In a bus topology, all network nodes share a single common transmission backbone cable, making it cost-effective to deploy but vulnerable to total failure if the central bus breaks.
p.192In a star topology, each device connects directly to a central hub or switch; a failure in an individual node cable leaves the rest unaffected, but a central device breakdown halts the whole network.
p.193A tree or hybrid topology organizes nodes hierarchically into multiple branches combining different topologies, such as several star networks connected along a common bus backbone.
p.193A Media Access Control (MAC) address is a globally unique 48-bit (12-digit hexadecimal) physical address permanently engraved onto the NIC by the manufacturer to identify a machine on a network.
p.194The first 24 bits of a MAC address represent the manufacturer's Organisational Unique Identifier (OUI), whereas the remaining 24 bits represent the serial number assigned to the NIC.
p.194An IP address is a unique logical identifier assigned to each node using the Internet Protocol for communication, which changes whenever a device disconnects and reconnects to a different network.
p.194An IPv4 address is a 32-bit numeric address expressed as four decimal numbers from 0 to 255 separated by periods, providing nearly 4.3 billion unique network addresses.
p.195An IPv6 address uses 128 bits expressed as eight groups of four hexadecimal digits separated by colons, designed to overcome the address exhaustion of 32-bit IPv4.
p.195The Internet architecture links subscriber devices via modems to local ISPs, which interconnect into regional networks and national backbones to form a global network.
p.195The Internet of Things (IoT) is a network of smart physical devices, electronic appliances, and sensors that communicate and exchange data across the Internet autonomously.
p.195The World Wide Web (WWW) is an information retrieval system of interlinked hypertext documents and resources stored on servers globally and accessed across the Internet.
p.196HTML is the standard markup language used to design the structure of web pages, while a Uniform Resource Locator (URL) provides the unique global address or path for web resources.
p.196The HyperText Transfer Protocol (HTTP), along with its encrypted counterpart HTTPS, defines the set of rules used to retrieve and transfer linked web pages across the web.
p.196A domain name is a memorable, human-readable alphanumeric hostname assigned to a web server's numerical IP address to simplify website identification.
p.197Domain name resolution is the process performed by DNS servers of converting a human-readable domain name entered in a browser into its corresponding numerical IP address.
p.198DNS servers are arranged in a hierarchical order headed by 13 root server clusters labeled A through M, whose authoritative registry is maintained by IANA.
p.198When resolving a URL, a DNS server returns the mapped IP address directly from its database or points to other hierarchical DNS servers until the domain entry is located.
p.198
Data Communication
8 topics · 8 formulas · 41 facts
- 1Concept of Communication
- 2Components of Data Communication
- 3Measuring Capacity of Communication Media
- 4Types of Data Communication
- 5Switching Techniques
- 6Transmission Media
- 7Mobile Telecommunication Technologies
- 8Protocol
- Bandwidth of a composite signalp.205
- Conversion of Kilohertz to Hertzp.205
- Conversion of Megahertz to Hertzp.205
- Conversion of Kilobits per second to bits per secondp.205
- Conversion of Megabits per second to Kilobits per secondp.205
- Conversion of Gigabits per second to Megabits per secondp.205
- Conversion of Terabits per second to Gigabits per secondp.205
- Relation between Megabytes per second and Megabits per secondp.205
Data communication refers to the exchange of data between two or more networked or connected devices capable of sending and receiving data over a communication medium.
p.203The five essential components of data communication are the sender, receiver, transmission medium, message, and protocol.
p.204In computer communication networks, the communicating sender and receiver computing devices are known as nodes.
p.204A message is the data or information exchanged between sender and receiver, which can be in the form of text, numbers, images, audio, video, or multimedia.
p.205A protocol is a set of rules that communicating parties must follow to achieve successful and reliable data communication.
p.205The capacity of a channel is the maximum amount of signals or traffic that a channel can carry, measured in terms of bandwidth and data transfer rate.
p.205Bandwidth is the range of frequencies available for transmission of data through a channel, calculated as the difference between the maximum and minimum frequencies in composite signals.
p.205Data transfer rate, also known as bit rate, is the number of bits transmitted between source and destination in one second, measured in bits per second (bps).
p.205In simplex communication, data transmission is unidirectional from sender to receiver, and devices utilize the entire capacity of the link to transmit data in one direction.
p.206Half-duplex communication is bidirectional between two devices where both can send and receive data, but not simultaneously at the same time.
p.206In a walkie-talkie, pressing the push-to-talk button enables the transmitter and turns off the receiver in that device so that other connected devices can only listen.
p.207Full-duplex communication allows both communicating devices to transmit and receive data simultaneously by sharing the channel capacity or using separate transmission lines.
p.207Switching routes data through various nodes in a network to form temporary transmission routes, avoiding the costly requirement of dedicated links between every pair of devices.
p.208In circuit switching, a dedicated physical path consisting of a connected sequence of links is established between sender and receiver before communication starts, and all packets follow this same path.
p.208In packet switching, messages are divided into smaller pieces called packets containing a destination header and data payload, which travel independently across available network routes.
p.208Unlike circuit switching where a dedicated path remains reserved, packet switching occupies a channel only during the transmission of a packet, freeing the channel for other traffic immediately upon completion.
p.208Guided transmission media propagate signals over physical wires or cables, whereas unguided transmission media propagate electromagnetic waves through the air using an antenna.
p.209Repeaters are installed along communication paths to regenerate signals to their original energy level after waves gradually attenuate over distance.
p.210A twisted-pair cable consists of two copper wires insulated with plastic and twisted in a helical structure to minimize electrical interference from neighboring pairs.
p.210Coaxial cable consists of a central copper core, insulating material, an outer braided copper conductor shield, and a protective plastic cover to transmit high-frequency signals with minimal interference.
p.211Optical fiber cable carries data as light pulses inside a central glass strand using refraction, surrounded by a less dense glass layer called cladding and a protective outer jacket.
p.212Optical fiber cables provide high bandwidth, light weight, and complete immunity to electromagnetic noise, but are unidirectional and require two cables for full-duplex communication.
p.212Radio waves have a frequency range of 3 KHz to 1 GHz, travel omni-directionally in all directions, and can penetrate solid walls, but remain susceptible to interference.
p.213Microwaves have a frequency range of 1 GHz to 300 GHz, are unidirectional, cannot penetrate solid objects like walls or hills, and require line-of-sight propagation between antennas.
p.213Infrared waves have a frequency range of 300 GHz to 400 THz, cannot penetrate solid walls, and are used for short-distance point-to-point communication such as remote controls.
p.213Bluetooth uses a low-cost transceiver chip operating in the unlicensed 2.4 GHz band to transmit data over a range of 10 meters at speeds of 1 to 2 Mbps.
p.214A Bluetooth piconet operates in a master-slave configuration where a master device can communicate with up to 7 active slave devices simultaneously out of up to 255 total network devices.
p.214Wireless LAN, standardized by IEEE as 802.11 and popularly known as Wi-Fi, connects wireless devices to a wired router, switch, or hub via access points (APs).
p.214WiMax uses a larger spectrum than Wi-Fi to deliver connections across larger areas with higher data transfer rates, making it suitable for Metropolitan Area Network (MAN) applications.
p.215First generation (1G) mobile network systems, introduced around 1982, transmitted voice calls exclusively using analog signals.
p.215Second generation (2G) mobile networks, introduced around 1991, transmitted voice calls in digital form with signal encryption and introduced SMS and MMS capabilities.
p.215Third generation (3G) mobile networks, introduced commercially around 2001, provided simultaneous digital voice and broadband Internet services via cellular towers.
p.215Fourth generation (4G) networks offer significantly higher data speeds than 3G systems to support interactive multimedia, high-definition voice and video, and broadband wireless services.
p.216Fifth generation (5G) mobile technology is designed to deliver data transfer speeds in Gbps to power Machine-to-Machine (M2M) communications, connected vehicles, and the Internet of Things.
p.216Flow control is a protocol mechanism required to handle speed mismatches between sender and receiver so transmission rates can be adjusted to prevent data packet loss.
p.216Access control is a protocol mechanism that determines which node accesses a shared channel at any instant, preventing data packets from colliding and corrupting data.
p.216HyperText Transfer Protocol (HTTP) is a request-response client-server protocol running over TCP that defines how web pages are formatted, transmitted, and retrieved on the World Wide Web.
p.217File Transfer Protocol (FTP) operates on a client-server model to establish connections between systems and handle differing file naming conventions, data formats, and directory structures.
p.218Point to Point Protocol (PPP) establishes a dedicated, direct duplex link between two devices to authenticate communicating endpoints, maintain data integrity, and retransmit damaged packets.
p.218Simple Mail Transfer Protocol (SMTP) handles email delivery by inspecting recipient addresses in the message header and routing queued emails to destination user mailboxes.
p.219In the TCP/IP protocol suite, IP assigns unique addresses to identify and route packets across network routers, while TCP segments data, ensures delivery, and reassembles packets in sequence.
p.219
Security Aspects
9 topics · 41 facts
- 1Threats and Prevention
- 2Malware
- 3Antivirus
- 4Spam
- 5HTTP vs HTTPS
- 6Firewall
- 7Cookies
- 8Hackers and Crackers
- 9Network Security Threats
Network security is concerned with the protection of computing devices and data from illegitimate access, misuse, or unauthorised modification.
p.223A security threat refers to any method by which an attacker exploits a vulnerability or weakness in a network or communication system to cause harm or damage reputation.
p.223Malware, short for malicious software, is any software developed with the intent to damage hardware, corrupt software, steal sensitive data, or disrupt user operations.
p.224A computer virus spreads by inserting its code into executable programs or files and remains dormant until the infected host program is executed by a user.
p.224Unlike a virus, a computer worm is a standalone program that does not require a host program and replicates automatically across network connections without human triggering.
p.225Ransomware targets user data by encrypting files or blocking access and demanding ransom payments, typically in cryptocurrency, to restore accessibility.
p.225A Trojan horse disguises itself as legitimate software to deceive users into installing it, does not self-replicate, and often establishes backdoors for unauthorised remote access.
p.226Spyware covertly gathers user information such as internet browsing habits, credentials, and financial details, transmitting them to external parties without user consent.
p.226Adware generates revenue for developers by displaying advertisements through pop-ups, web pages, or installation screens, frequently charging advertisers via a pay-per-click model.
p.226A keylogger can be implemented via software or hardware to record every keystroke entered by a user, secretly capturing sensitive credentials and personal messages.
p.227An online virtual keyboard randomises its key layout on every use, preventing keystroke logging attacks that easily exploit the fixed QWERTY layout of on-screen keyboards.
p.227Malware spreads across computer systems via unintentional internet downloads, malicious email links or attachments, infected removable storage media, and automated network propagation.
p.228Essential malware prevention practices include regularly updating antivirus software, installing manufacturer security patches, taking data backups, and avoiding pirated or unlicensed software.
p.229Modern antivirus software provides computer systems with integrated defensive capabilities for the prevention, detection, and removal of diverse malware threats.
p.230Signature-based detection identifies malware by matching consecutive byte sequences against a Virus Definition File, but fails against polymorphic or encrypted malware.
p.230Sandbox detection executes an untrusted application within an isolated virtual environment to inspect its behavioural fingerprint without exposing actual system resources.
p.230Data mining detection utilizes machine learning algorithms and analytical techniques to classify program and file behavior as either benign or malicious.
p.230Spam refers to unsolicited bulk electronic messages distributed to large mailing lists, cluttering user inboxes and frequently serving as delivery vectors for malware.
p.231Email platforms employ automated spam filtering algorithms to segregate junk messages, and users can manually mark undetected emails as spam to prevent future delivery.
p.231HTTP transmits data across the World Wide Web in unencrypted plain text without scrambling, leaving sensitive communication vulnerable to network packet interception.
p.231HTTPS provides secure data transfer by encrypting data before transmission and decrypting it at the destination, requiring an SSL digital certificate on the server.
p.232A firewall is a network security system that protects a trusted private network from unauthorized external traffic by continuously enforcing predefined security rules.
p.232Firewalls can be implemented in software, hardware, or both, functioning as an essential initial barrier to intercept network-propagating threats such as worms.
p.232A network firewall monitors traffic between two or more different networks, whereas a host-based firewall resides on an individual computer to control its incoming and outgoing traffic.
p.233A cookie is a small text file or data packet stored by a web server on a client computer that can only be edited by the originating website.
p.233Session cookies monitor active browsing interactions and terminate sessions upon time-out, whereas authentication cookies verify existing login credentials across web pages.
p.233Third-party cookies track user activity across multiple external websites without explicit consent to aggregate personal browsing history for targeted advertising.
p.234Zombie cookies automatically recreate themselves after deletion by the user, while supercookies disguise malicious software code within cookie storage structures.
p.234White hat hackers, or ethical hackers, are security professionals who identify and remediate system vulnerabilities legally to protect organisational networks.
p.234Black hat hackers, known as crackers, use their computer expertise unethically to exploit security flaws, violate laws, and gain unauthorised access to systems.
p.234A hacktivist is a computer hacker whose intrusion activities are driven by the motivation to provoke political or social change.
p.234Grey hat hackers find and exploit security vulnerabilities for curiosity or recreation without malicious intent, financial motives, or political agendas.
p.235A Denial of Service (DoS) attack overloads a server or network resource with illegitimate traffic, preventing authorized users from accessing the service.
p.235In a Distributed Denial of Service (DDoS) attack, the attacker coordinates a Bot-Net of compromised zombie computers distributed across the globe to flood the target.
p.235Asymmetric routing intrusion bypasses perimeter network intrusion detection sensors by splitting and transmitting malicious packets across multiple different network paths.
p.236A buffer overflow attack exploits programming errors by overwriting target memory boundaries with executable commands to gain unauthorized access or trigger service crashes.
p.236Traffic flooding saturates a network intrusion detection system with massive message volume, creating congestion that enables an attacker to infiltrate undetected.
p.236Snooping, also called sniffing, is the covert capture and analysis of network packets from a communication channel, which can be prevented by end-to-end data encryption.
p.236Network switches provide SPAN (Sniffer Port Analyser) port capabilities that mirror packet traffic for legitimate diagnostics or covert network snooping.
p.237Eavesdropping is the unauthorized, real-time interception and monitoring of private communications such as VoIP telephone calls, video conferences, and instant messages.
p.237The essential distinction between eavesdropping and snooping is that eavesdropping intercepts communication dynamically in real time, whereas snooping captures and stores packets for later analysis.
p.238
Project Based Learning
3 topics · 39 facts
- 1Approaches for Solving Projects
- 2Teamwork
- 3Project Descriptions
Project based learning provides students with practical exposure to real-world problems, enabling them to organise projects and manage time effectively.
p.241Developing projects in groups helps students acquire essential skills including collaborative teamwork, problem solving, decision making, and investigation.
p.241Project based learning involves analysing the problem, formulating it into manageable modules, applying solving methods to each module, and integrating module solutions.
p.241Solving a problem requires team members to gather relevant project data and process it by applying an appropriate systematic method.
p.241Project data must be collected in a specified format according to project requirements, processed to solve the problem, and reported in a predetermined format.
p.242Common execution strategies in project based learning include the modular approach, the top-down approach, and the bottom-up approach.
p.242In a modular or structured approach, a project is divided into manageable modules where each module performs a well-defined task with specific inputs to produce desired outputs.
p.242Project identification involves deriving project ideas from real-life situations, understanding project usefulness and impact, and encouraging interdisciplinary work.
p.242Defining a project plan requires selecting a project leader, clearly assigning defined roles and activities to each team member, and identifying execution tools.
p.242To achieve a robust solution during project planning, team members must always anticipate and plan for extreme situations.
p.242Every project is time-relevant, requiring a well-structured schedule for all activities while maintaining flexibility in its time frame.
p.242When participants get stuck during a project process, guidance can be obtained from external resources such as books, websites, and subject experts.
p.243Project monitoring is carried out under the responsibility of the project leader along with active guidance and support from the guide teacher.
p.243A project may produce single or multiple outcomes, and project output can be peer reviewed and modified according to feedback from teachers and users.
p.243Teamwork is defined as the collective efforts made by individuals to accomplish a complex real-life task.
p.243Successful teamwork requires diverse skilled team members with clearly specified roles collaborating beyond mere technical proficiency.
p.244Effective communication among team members via emails, phone calls, or group meetings helps team members understand each other and resolve issues.
p.244Listening to others in group meetings is essential to understand diverse viewpoints and ensure the team follows agreed-upon implementation steps.
p.244Sharing ideas, images, tools, and technical expertise among team members is vital to achieve project goals within the designated time frame.
p.244Respecting the thoughts and ideas of every team member prevents conflict and encourages all members to contribute their best efforts.
p.244Providing a helping hand to fellow members, and seeking assistance from individuals outside the team when needed, is key to project success.
p.244Encouraging active participation in project tasks and group discussions ensures every team member recognizes their value in the team.
p.245Students can choose suggested project ideas or select alternative projects developed in consultation with their guide teacher.
p.245The restaurant order processing software requires two distinct login modes: one for the manager and another for the customer.
p.245Customer reception kiosks run order processing software where an interactive menu is displayed on the opening screen for placing food orders.
p.245Customers place orders by entering Item Codes and desired quantities, after which a soft copy of the bill displaying an Order Number is shown on screen.
p.245Every generated bill must carry a unique identification, such as a combination of date and daily order number, and be saved in a data file or database.
p.245In the restaurant ordering application, the Order Number counter resets and starts from 1 each day.
p.245The manager login enables entering or updating the menu, deleting orders on demand, and generating daily sales summary reports for a specified date.
p.246The Python bomb puzzle game requires a player to clear a board of cells without detonating any hidden bomb by using revealed numerical clues.
p.246In the puzzle game, clicking a cell containing a bomb ends the game, whereas clicking a safe cell reveals the number of bombs hidden in adjacent cells.
p.246To limit software complexity in the puzzle game project, the grid board can be fixed to a 6x6 size with exactly 6 hidden bombs.
p.246Developers of the puzzle game must implement exception handling in their Python code to manage runtime exceptions that may occur during play.
p.246The Match the Sum educational game is designed to build summing skills for children aged 5 to 7 years by allowing them to form the number 10 from 2 or 3 digits.
p.246The educational game interface displays a list of 15 cells where each cell holds a single digit from 1 to 9.
p.247The game program periodically generates random digits at equal time intervals, placing each into the rightmost cell and shifting existing digits left by one cell.
p.247When a player enters 2 or 3 displayed digits whose sum equals 10, those digits are removed from the active list of cells.
p.247The educational summing game terminates when all 15 cells are occupied and no empty cell remains to insert a newly generated digit.
p.247The educational game program must include logic to handle conditions where the digits currently displayed in the cells cannot add up to 10.
p.247