Time complexity describes how the running time of an algorithm grows as the size of its input (n) increases. By analyzing time complexity, we can compare algorithms and predict how they’ll scale. This article covers foundational concepts, growth‑rate...
Hello Techiessss!! When we first start learning to code, we often hear this advice "Keep your code short the shorter, the better!" But is short code always the smartest choice? 🤔 Imagine your friend tells you "Take the shortcut, it's faster." But th...
Array & → Address of eg - & Myarray[0] = Myarray = 100 * → Value at eg - * (Myarray) = 5 * (Myarray + 1) = 10 Let ‘a’ be the name of the array - *a = *(a+0) = a[0] = 5; *(a+2) = a[2] = 15; (a+i) = Base address + i * (size of datatype)...
Array Collection of similar type of data. Also the size of array is fixed. Creating an Array syntax : datatype variable_name [size]; example : int MyArray [5]; Initialisation int arr[5] = {1, 2, 3, 4, 5}; int arr[] = {1, 2, 3, 4}; int arr...
Recursion → A function calling itself is known as Recursion. usually recursion take more time and memory than loops. also there is risk of stack overflow for large values. /* SYNTAX return_type function_name(parameters) { // Base case (term...
Notation Best case → Omega Notation - Ω Describes the minimum time the algorithm could take. example: Linear Search - Ω(1) Average case → Theta Notation - Θ Describes the tight bound - when best and worst cases grow the same. Traversing an arra...
Basic Definition Data - refers to raw facts and figures (may not have any meaning)→ It is used in computation after processing. It has the following types : Primitive: int – Integer values (e.g., …, -1, 0, 1,…) float – Decimal numbers (e.g., -5.4...