technology in business intelligence, Slides of Computer Science

it talks about technologies used in business intelligence

Typology: Slides

2022/2023

Uploaded on 07/22/2023

ashu-kharel
ashu-kharel 🇳🇵

1 document

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SPACE Complexity
Presented by:
Ashutosh
Kharel
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download technology in business intelligence and more Slides Computer Science in PDF only on Docsity!

SPACE Complexity

Presented by:

Ashutosh

Kharel

Contents Introduction Space Complexity Types of Space Complexity Why do we need to Calculate Space Complexity? How to calculate space complexity

For any algorithm, memory is required for the following purposes:

  • To store program instructions.
  • To store constant values.
  • To store variable values.
  • And for a few other things like function calls, jumping statements, etc. S pace Complexity = Auxiliary space + space used for input values Auxiliary space: is the temporary space (excluding the input size) allocated by your algorithm to solve the problem, with respect to concerning input size. Input values: These refer to the size of the input that is provided to an algorithm or program. It represents the amount of data or the number of elements that the algorithm needs to process. Space Complexity

Type 1: A fixed part that is a space required to store certain data and variables, that are independent of the size of the problem. Type 2: A variable part is a space required by variables, whose size depends on the size of the problem. #include<stdio.h> Fixed part: 10 int main() Variable part: a, b, and c { int a, b, c; c = a + b + 10 ; printf("%d", c); } Types of Space Complexity

For calculating the space complexity, We need to know the amount of memory used by different types of datatype variables, program instructions, constant values, and a few other things like function calls, and recursion stack(in recursion case). Data type in C programming language: int 4 bytes float 4 bytes double 8 bytes char 1 byte short int 2 bytes long int 4 bytes How to calculate space complexity

(EXAMPLE)

int main() (EXAMPLE) { int a = 10; float b = 20.5; char c = 'A'; int d[10]; return 0; } To calculate the complexity of this algorithm, we need to determine the amount of memory used by each of the variables. In this case:

  • (^) a is an integer, which takes up 4 bytes of memory.
  • (^) b is a float, which takes up 4 bytes of memory.
  • (^) c is a character, which takes up 1 byte of memory.
  • (^) d is an array of 10 integers, which takes up 40 bytes of memory (10 x 4). So, the total amount of memory used by this algorithm is 4 + 4 + 1 + 40 = 49 bytes.