Spacebar
for next slide. Esc
or 'o
' for overview.
https://programming-workshop.netlify.app/#/
Write a program to print numbers 1 to 10
An infinite loop is a sequence of instructions that, as written, will continue endlessly, unless an external intervention occurs.
An Array is a collection of items stored at contiguos memory locations.
Problem to store ages of 100 people and iterating over it
Sometimes it’s better to give the address of your home rather than giving your home.
Time complexity is simply a measure of the time it takes for a function or expression to complete its task, as well as the name of the process to measure that time.
N = 1000033 ( Prime number )
Time taken by A's program = 1 ms * number of divisions
= 1 ms * 1000033
= approximately 1000 seconds or 16.7 mins.
Time taken by B's program = 1ms * number of divisions
= 1ms * square root of 1000033
= approximately 1000ms = 1 second.
N = 1500450271 ( Prime number )
Time taken by A's program = 1 ms * number of divisions
= 1 ms * 1500450271
= approximately 1000000 seconds or 11.5 days.
Time taken by B's program = 1ms * number of divisions
= 1ms * square root of 1500450271
= approximately 40000ms = 40 seconds.
BrainStorming Sessions
Space complexity is a measure of how efficient your code is in terms of memory used.
A 2 gigahertz processor means 2*10^9 operations cycles per second.
Insertion sort is a sorting algorithm that places an unsorted element at its suitable place in each iteration. Insertion sort works similarly as we sort cards in our hand in a card game.
Merge Sort is a sorting algorithm, which is commonly used in computer science. Merge Sort is a divide and conquer algorithm. It first divides the array into equal halves and then combines them in a sorted manner.
A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations.
There are 3 different implementations of Linked List available, they are:
Singly linked lists contain nodes which have a data part as well as an address part i.e. next, which points to the next node in the sequence of nodes.
In a doubly linked list, each node contains a data part and two addresses, one for the previous node and one for the next node.
In a circular linked list the last node of the list holds the address of the first node hence forming a circular chain.
Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out).
Position of Top | Status of stack |
---|---|
-1 | Stack is empty |
0 | Only one element is stack |
N-1 | Stack is full |
N | Overflow state of stack |
Queue is also an abstract data type or a linear data structure in which the first element is inserted from one end called the REAR(also called tail), and the removal of the existing element takes place from the other end called FRONT(also called head).
The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called a recursive function.
In mathematics, the sieve of Eratosthenes is a simple, ancient algorithm for finding all prime numbers up to any given limit. It does so by iteratively marking as composite (i.e., not prime) the multiples of each prime, starting with the first prime number, 2. The multiples of a given prime are generated as a sequence of numbers starting from that prime, with constant difference between them that is equal to that prime.[1] This is the sieve's key distinction from using trial division to sequentially test each candidate number for divisibility by each prime.
For Any Queries
Nibble Computer Society