good new report fun enjoyThe WiMAX (IEEE 802.16e) standard offers peak data rates of 128Mbps downlink and
56Mbps uplink over 20MHz wide channels whilst the new standard in development, 4G
WiMAN-Advanced (802.16m) is targeting the requirements to be fully 4G using 64Q QAM,
BPSK and MIMO technologies to reach the 1Gbps rate. It is predicted that in an actual
deployment, using 4X2 MIMO in an urban microcell application using a 20 MHz TDD
channel, the 4G WiMAN-Advanced system will be able to support 120Mbps downlink and
60Mbps uplink per site concurrently. WiMAX applications are already in use in many countries
globally but research in 2010 gave results that showed only just over 350 set ups were actually
in use. Many previous WiMAX operators were found to have moved to LTE along with Yota,
who were the largest WiMAX operator in the world.
1. A MOOC Course Report on
PROGRAMMING, DATA STRUCTURES AND ALGORITHMS USING PYTHON
Submitted by
KRIPANSHU SHEKHAR JHA (RA2011003030071)
Under the guidance of
PROFESSOR MADHAVAN MUKUND
Under the governing NPTEL body
of
BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE & ENGINEERING
of
FACULTY OF ENGINEERING AND TECHNOLOGY
SRM INSTITUTE OF SCIENCE & TECHNOLOGY,NCR CAMPUS
NOV 2022
3. Course Outline
Week 1: Introduction to Algorithms and Programming
Week 2: Strings, Lists, Control Flow and Function
Week 3: Manipulating list, break, Array vs List, Binary Search, Selection and Insertion Sort, and
Recursion
Week 4: Merge Sort, Quick Sort, Tuples and Dictionaries
Week 5: Exception Handling, Handling files
Week 6: Backtracking, Nested Function, Sets, Stack and Queue
Week 7: Abstract data type, Classes and Objects
Week 8: Dynamic Programming and Memoization
4. Week 1: Introduction to Algorithms and Programming
In this week we learned about algorithms and some
basics of programming.
An algorithm is nothing but a set of rules that must be
followed while solving a problem. There are mainly 4
types of algorithms i.e. Brute Force, Greedy, Recursive
and Backtracking algorithm.
In any programming language there are certain concepts
that we must know to do programming and write codes.
The basic concepts are variables, data structures, control
structures and syntax.
5. We also learned about the gcd(Greatest common divisor) function which is used to
determine the greatest common divisor of the given two numbers and how to optimize
the brute force approach to reduce the computation time and have a better time
complexity.
To optimize the function we use Euclid’s algorithm which is based on the below facts-
1. If we subtract a smaller number from a larger one (we reduce a larger number), gcd
doesn’t change. So if we keep subtracting repeatedly the larger of two, we end up with
GCD.
2. Now instead of subtraction, if we divide the smaller number, the algorithm stops
when we find the remainder 0.
6. Week 2: Strings, Lists, Control Flow and Function
Learned about various data types like int, float and
bool. Int data type is used to store integer type values.
Float type values are used to store values that contain
decimal it them. And bool data type can only be used
to store either of the two values 0 and 1 that are also
considered as False and True values respectively.
Strings are the data types that are used to store words
or sentences.
Lists are very useful data types that are used to
maintain multiple elements of same or different type.
Control flow is used to determine the flow of the
program. Certain if else statements or switch case
statements are used to control the flow of the code.
If the condition statement specified is true then the
body of if statement is executed otherwise the
following else statement is executed if there is one.
7. Week 3: List, Binary Search, Selection and Insertion Sort, and Recursion
Lists are a mutable data type in python which means
that once a list is created elements can be modified
and individual values can be replaced.
Lists is used to collect items that usually consist of
elements of multiple data types. AN array is also a
vital component that collects several items of the
same data type.
List cannot manage arithmetic operation whereas
array cam manage arithmetic operation.
Binary search is a searching algorithm for finding an
element in a sorted array by repeatedly dividing the
search interval in half. In this the element is always
searched in the middle of the interval.
8. Selection sort is an effective and efficient sort algorithm
based on comparison operations. It adds one element in
each iteration. You need to select the smallest element in
the array and move it to the beginning of the array by
swapping with the front element
Insertion sort is a simple sorting algorithm that works
similar to the way you sort playing cards in your hands.
The array is virtually split into a sorted and an unsorted
part. Values from the unsorted part are picked and
placed at the correct position in the sorted part.
9. Week 4: Merge Sort, Quick Sort, Tuples and Dictionaries
Merge sort is one of the most efficient sorting
algorithms. It is based on the divide-and-conquer
strategy. Merge sort continuously cuts down a list
into multiple sub lists until each has only one item,
then merges those sub lists into a sorted list.
Quicksort is a divide-and-conquer algorithm. It
works by selecting a 'pivot' element from the array
and partitioning the other elements into two sub-
arrays, according to whether they are less than or
greater than the pivot. For this reason, it is
sometimes called partition-exchange sort.
10. Tuples are used to store multiple items
in a single variable. Tuple is one of 4
built-in data types in Python used to store
collections of data, the other 3 are List,
Set, and Dictionary, all with different
qualities and usage. A tuple is a collection
which is ordered and unchangeable.
Dictionary. Dictionaries are used to store
data values in key: value pairs. A
dictionary is a collection which is
ordered*, changeable and do not allow
duplicates. As of Python version 3.7,
dictionaries are ordered. In Python 3.6
and earlier, dictionaries are unordered.
11. Week 5: Exception Handling, Handling files
Exceptions are raised when the program is syntactically
correct, but the code resulted in an error. This error does
not stop the execution of the program, however, it changes
the normal flow of the program. Try and except
statements are used to catch and handle exceptions in
Python. Statements that can raise exceptions are kept
inside the try clause and the statements that handle the
exception are written inside except clause.
12. We should use Python’s inbuilt function open() but at the
time of opening, we have to specify the mode, which
represents the purpose of the opening file. f =
open(filename, mode)
Where the following mode is supported:
1. r: open an existing file for a read operation.
2. w: open an existing file for a write operation. If the file
already contains some data then it will be overridden but if
the file is not present then it creates the file as well.
3. a: open an existing file for append operation. It won’t
override existing data.
4. r+: To read and write data into the file. The previous data
in the file will be overridden.
5. w+: To write and read data. It will override existing data.
6. a+: To append and read data from the file. It won’t override
existing data.
13. Week 6: Backtracking, Nested Function, Sets, Stack and Queue
Backtracking is a form of recursion. But it involves choosing
only option out of any possibilities. We begin by choosing an
option and backtrack from it, if we reach a state where we
conclude that this specific option does not give the required
solution.
Inner functions, also known as nested functions, are functions
that you define inside other functions. In Python, this kind of
function has direct access to variables and names defined in the
enclosing function. Inner functions have many uses, most notably
as closure factories and decorator functions.
A stack is a linear data structure that stores items in a Last-
In/First-Out (LIFO) or First-In/Last-Out (FILO) manner. In
stack, a new element is added at one end and an element is
removed from that end only. The insert and delete operations are
often called push and pop.
Like stack, queue is a linear data structure that stores items in
First In First Out (FIFO) manner. With a queue the least
recently added item is removed first. A good example of queue is
any queue of consumers for a resource where the consumer that
came first is served first.
14. Week 7: Abstract data type, Classes and Objects
Abstract Data type (ADT) is a type (or class) for objects
whose behavior is defined by a set of values and a set of
operations. The definition of ADT only mentions what
operations are to be performed but not how these operations
will be implemented. It does not specify how data will be
organized in memory and what algorithms will be used for
implementing the operations. It is called “abstract” because
it gives an implementation-independent view.
The process of providing only the essentials and hiding the
details is known as abstraction.
A class is a code template for creating objects. Objects
have member variables and have behavior associated with
them. In python a class is created by the keyword class . An
object is created using the constructor of the class. This
object will then be called the instance of the class.
An object is simply a collection of data (variables) and
methods (functions) that act on those data. Similarly, a
class is a blueprint for that object. We can think of a class
as a sketch (prototype) of a house. It contains all the details
about the floors, doors, windows, etc.
15. Week 8: Dynamic Programming and Memoization
Dynamic Programming is mainly an optimization
over plain recursion. Wherever we see a recursive
solution that has repeated calls for same inputs, we
can optimize it using Dynamic Programming. The
idea is to simply store the results of subproblems,
so that we do not have to re-compute them when
needed later. This simple optimization reduces
time complexities from exponential to polynomial.
For example, if we write simple recursive solution
for Fibonacci Numbers, we get exponential time
complexity and if we optimize it by storing
solutions of subproblems, time complexity reduces
to linear.
16. Memoization is a technique of recording the
intermediate results so that it can be used to avoid
repeated calculations and speed up the programs. It
can be used to optimize the programs that use
recursion. In Python, memoization can be done with
the help of function decorators.
Memoization allows you to optimize a Python
function by caching its output based on the
parameters you supply to it. Once you memoize a
function, it will only compute its output once for
each set of parameters you call it with. Every call
after the first will be quickly retrieved from a cache.