2CC - Rajat - Rajat Sablok
2CC - Rajat - Rajat Sablok
2CC - Rajat - Rajat Sablok
Simply put, a data structure is a container that stores data in a specific layout. This “layout” allows a
data structure to be efficient in some operations and inefficient in others. Your goal is to understand
data structures so that you can pick the data structure that’s most optimal for the problem at hand.
Why do we need Data Structures? As data structures are used to store data in an organized form,
and since data is the most crucial entity in computer science, the true worth of data structures is
clear. No matter what problem are you solving, in one way or another you have to deal with data —
whether it’s an employee’s salary, stock prices, a grocery list, or even a simple telephone directory.
Based on different scenarios, data needs to be stored in a specific format. We have a handful of data
structures that cover our need to store data in different formats.
Arrays
An array is the simplest and most widely used data structure. Other data structures like stacks and
queues are derived from arrays. Each data element is assigned a positive numerical value called the
Index, which corresponds to the position of that item in the array. The majority of languages define
the starting index of the array as 0. The following are the two types of arrays: One-dimensional
arrays (as shown above) Multi-dimensional arrays (arrays within arrays)
Stacks
We are all familiar with the famous Undo option, which is present in almost every application. Ever
wondered how it works? The idea: you store the previous states of your work (which are limited to a
specific number) in the memory in such an order that the last one appears first. This can’t be done
just by using arrays. That is where the Stack comes in handy. A real-life example of Stack could be a
pile of books placed in a vertical order. In order to get the book that’s somewhere in the middle, you
will need to remove all the books placed on top of it. This is how the LIFO (Last In First Out) method
works. Basic operations of stack:
Similar to Stack, Queue is another linear data structure that stores the element in a sequential
manner. The only significant difference between Stack and Queue is that instead of using the LIFO
method, Queue implements the FIFO method, which is short for First in First Out. A perfect real-life
example of Queue: a line of people waiting at a ticket booth. If a new person comes, they will join
the line from the end, not from the start — and the person standing at the front will be the first to
get the ticket and hence leave the line.
Recursion
Recursion means "defining a problem in terms of itself". This can be a very powerful tool in writing
algorithms. Recursion comes directly from Mathematics, where there are many examples of
expressions written in terms of themselves.
There are three steps to solve a problem using Recursion, by breaking it into –
• Base condition
• Hypothesis
• Induction
The most popular example of recursion is the calculation of the factorial. Mathematically the
factorial is defined as: n! = n * (n-1)!
While we can implement factorial using a loop, its recursive function involves successively calling it
by decrementing the number until it reaches 1. The following is a recursive function to calculate the
factorial in python.
Code
def factorial(n):
if n == 1:
print(n)
return 1
else:
return n * factorial(n-1)
factorial(n)
Output (n=5)
Enter a number 5
5*4*3*2*1
120
When the factorial function is called with 5 as argument, successive calls to the same function are
placed, while reducing the value of 5. Functions start returning to their earlier call after the
argument reaches 1. The return value of the first call is a cumulative product of the return values of
all calls.
ONLINE WEBINARS
A lot of webinars were conducted by club members on various web technologies such as Cloud
Security, JavaScripts related webinars on nodejs and reactjs, competitive coding , mongodb ,
express.
Cloud Security
This guest lecture was delivered by Ratika Singh and Amit Malhotra (IHS Markit).
Cyber security is the practice of protecting systems, networks, and programs from digital attacks.
These cyber attacks are usually aimed at accessing, changing, or destroying sensitive information;
extorting money from users; or interrupting normal business processes.
Some of the important topics introduced and delved into during the webinar were -
1. What is virtualization?
2. How it is essential for cloud security?
3. Abstaction and orchestration
4. Private cloud vs public cloud services
5. Responsibility Matrix
Don’t REST, Let’s GraphQL!
GraphQL is an open-source data query and manipulation language for APIs, and a runtime for
fulfilling queries with existing data. GraphQL was developed internally by Facebook in 2012 before
being publicly released in 2015.
In this webinar we learnt about graphql. It was a live webinar hosted on youtube. Some of the
reason for using graphql is mentioned below:
Madhav Bahl, who is currently working at Microsoft as a SWE, was invited by CodeChef VIT to give a
lecture on the importance of having a portfolio website and how to build one using React JS, one of
the most popular JS frameworks. The portfolio website can be used to showcase your projects and
also your command over web development. It does not need to be too flashy but it should be clean
and contain the important contents like skills, projects, resume. After walking through the project
here are the things which can be improved