0% found this document useful (0 votes)
43 views32 pages

Viva

This document provides an overview of a 6-week training on data structures and algorithms. The training will cover fundamental CS topics like recursion, arrays, searching, sorting, strings, and linked lists. It will also cover specific data structures like stacks, queues, trees, heaps, and graphs. Students will learn to analyze algorithms, solve problems, and select the most efficient approach. The goal is to help students become better programmers by understanding how to implement, prove, evaluate, and discuss data structure and algorithm solutions and designs.

Uploaded by

Abhishek Rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views32 pages

Viva

This document provides an overview of a 6-week training on data structures and algorithms. The training will cover fundamental CS topics like recursion, arrays, searching, sorting, strings, and linked lists. It will also cover specific data structures like stacks, queues, trees, heaps, and graphs. Students will learn to analyze algorithms, solve problems, and select the most efficient approach. The goal is to help students become better programmers by understanding how to implement, prove, evaluate, and discuss data structure and algorithm solutions and designs.

Uploaded by

Abhishek Rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

CSE-343

SIX WEEKS
SUMMER
TRAINING
DATA STRUCTURES AND ALGORITHMS –
SELF PACED

BY GEEKSFORGEEKS
Certificate Introduction
CONTENTS

Reason for Learning


Opting Outcomes
CERTIFICAT
E
TOPICS COVERED DURING TRAINING

• Mathematics
• Bit Magic
• Recursion
• Arrays
• Searching
• Sorting
• Matrix
• String
• Linked List
INTRODUCTION

• A data structure is a way of organizing and storing data to


enable efficient manipulation, retrieval, and management.
• It defines how data elements are arranged and connected,
providing a framework for performing various operations
on the data.
• Data structures are fundamental in computer science and
are used to optimize algorithms and solve a wide range of
problems.
• For ex- Arrays,LinkedList,Stack ,Queue,Tree etc.
• The Bitwise Algorithms is used to perform
operations at the bit-level or to manipulate bits in
different ways. The bitwise operations are found to
be much faster and are sometimes used to improve
the efficiency of a program.

BIT MAGIC • For example: To check if a number is even or odd.


This can be easily done by using Bitwise-AND(&)
operator. If the last bit of the operator is set than it
is ODD otherwise it is EVEN. Therefore, if num &
1 not equals to zero than num is ODD otherwise it
is EVEN.
• The process in which a function calls itself
directly or indirectly is called recursion and the
corresponding function is called a recursive
function. Using a recursive algorithm, certain
RECURSION problems can be solved quite easily. Examples of
such problems are Towers of Hanoi (TOH), 
Inorder/Preorder/Postorder Tree Traversals, 
DFS of Graph, etc.
ARRAYS

• An array is a collection of items stored


at contiguous memory locations. The
idea is to store multiple items of the
same type together. This makes it
easier to calculate the position of each
element by simply adding an offset to
a base value, i.e., the memory location
of the first element of the array
(generally denoted by the name of the
array).
• Searching Algorithms are designed to check for an element or
retrieve an element from any data structure where it is stored.
Based on the type of search operation, these algorithms are
generally classified into two categories:
1. Sequential Search: In this, the list or array is traversed
sequentially and every element is checked. For example: 
SEARCHING Linear Search.
2. Interval Search: These algorithms are specifically designed
for searching in sorted data-structures. These type of
searching algorithms are much more efficient than Linear
Search as they repeatedly target the center of the search
structure and divide the search space in half. For Example: 
Binary Search.
• A Sorting Algorithm is used to rearrange a given
array or list of elements according to a comparison
operator on the elements. The comparison operator
is used to decide the new order of elements in the
respective data structure.
SORTING • For Example: The below list of characters is sorted
in increasing order of their ASCII values. That is,
the character with a lesser ASCII value will be
placed first than the character with a higher ASCII
value.
MATRIX

• A matrix represents a collection of


numbers arranged in an order of rows and
columns. It is necessary to enclose the
elements of a matrix in parentheses or
brackets
• For example:
• This Matrix [M] has 3 rows and 3
columns. Each element of matrix [M] can
be referred to by its row and column
number. For example, a23 = 6.
• Strings are defined as an array of characters. The
difference between a character array and a string
is the string is terminated with a special
character ‘\0’.
STRING • Below are some examples:
• “geeks”, “for”, “geeks”, “GeeksforGeeks”,
“Geeks for Geeks”, “123Geeks”, “@123
Geeks”
LINKED LIST

• A linked list is a linear data


structure, in which the elements are
not stored at contiguous memory
locations. The elements in a linked
list are linked using pointers as
shown in the below image:
STACK

• 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).
• A queue is defined as a linear data structure that
is open at both ends and the operations are
performed in First In First Out (FIFO) order.
• We define a queue to be a list in which all
QUEUE additions to the list are made at one end, and all
deletions from the list are made at the other end.
 The element which is first pushed into the order,
the operation is first performed on that.
• A tree is non-linear and a hierarchical data structure
consisting of a collection of nodes such that each node of
the tree stores a value and a list of references to other
nodes (the “children”).
• This data structure is a specialized method to organize

TREE and store data in the computer to be used more


effectively. It consists of a central node, structural nodes,
and sub-nodes, which are connected via edges. We can
also say that tree data structure has roots, branches, and
leaves connected with one another. 
• Binary Search Tree is a node-based binary tree
data structure which has the following
properties:
• The left subtree of a node contains only nodes
BINARY with keys lesser than the node’s key.
SEARCH TREE • The right subtree of a node contains only nodes
with keys greater than the node’s key.
• The left and right subtree each must also be a
binary search tree.
• A Heap is a special Tree-based data structure in which the
tree is a complete binary tree.
• Operations of Heap Data Structure:
• Heapify: a process of creating a heap from an array.
• Insertion: process to insert an element in existing heap time
HEAP complexity O(log N).
• Deletion: deleting the top element of the heap or the highest
priority element, and then organizing the heap and returning
the element with time complexity O(log N).
• Peek: to check or find the most prior element in the heap,
(max or min element for max and min heap).
• A Graph is a non-linear data structure consisting
of vertices and edges. The vertices are
sometimes also referred to as nodes and the
GRAPH edges are lines or arcs that connect any two
nodes in the graph. More formally a Graph is
composed of a set of vertices( V ) and a set of
edges( E ). The graph is denoted by G(E, V).
• Backtracking is an algorithmic technique for
solving problems recursively by trying to build a
BACKTRACKIN solution incrementally, one piece at a time,
removing those solutions that fail to satisfy the
G constraints of the problem at any point of time
(by time, here, is referred to the time elapsed till
reaching any level of the search tree).
• 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-
DYNAMIC compute them when needed later. This simple
optimization reduces time complexities from exponential
PROGRAMMING 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.
• Data structures and algorithms (DSA) goes
through solutions to standard problems in detail
WHY LEARN and gives you an insight into how efficient it is
to use each one of them. It also teaches you the
DSA science of evaluating the efficiency of an
algorithm. This enables you to choose the best of
various choices.
LEARNING OUTCOMES

• Understand the concept of Dynamic memory management, data types, algorithms, Big O
notation.
• Understand basic data structures such as arrays, linked lists, stacks and queues.
• Describe the hash function and concepts of collision and its resolution methods
• Solve problem involving graphs, trees and heaps
• Apply Algorithm for solving problems like sorting, searching, insertion and deletion of
data
CONCLUSION

• A module on data structures and algorithms is supposed to make better programmers. We do


that by stepping away from actual programming and try to view computer program from
outside.

• The key skills and competencies to learn are:


1. Being able to prove that an algorithm is correct.
2. Being able to assess the runtime complexity of an algorithm
3. Being able to communicate,discuss and evaluate solutions and partial designs for computer
programs.
PROJECT

Contact Management System using


Linkedlist Data Structure
OPERATIONS IMPLEMENTED

• 1)ADD CONTACTS
• 2)VIEW CONTACTS
• 3)DELETE CONTACT
• 4)EXIT
OUTPUT
Thank You

You might also like