0% found this document useful (0 votes)
22 views30 pages

Virtual Memory

The document discusses an introductory course on data structures using C language. It covers topics like prerequisites, what is data structure and why it is important, types of data structures, and an outline of the course including stacks, queues, linked lists, trees, graphs, recursion, complexity analysis, searching and sorting algorithms.
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)
22 views30 pages

Virtual Memory

The document discusses an introductory course on data structures using C language. It covers topics like prerequisites, what is data structure and why it is important, types of data structures, and an outline of the course including stacks, queues, linked lists, trees, graphs, recursion, complexity analysis, searching and sorting algorithms.
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/ 30

DATA STRUCTURES

USING “C”
Lecture 1
Today’s Agenda
• Prerequisites Of The Course

• What Is Data Structure And Why It Is So Important ?

• Data Structures V/s Algorithm

• Examples Of Data Structure And Algorithm In Real Life

• Types Of Data Structure

• Course Outline
Prerequisites
• To learn and implement codes in Data Structures we need:

• Knowledge Of Any One Programming Language

• We will use C-Language in this course

• No knowledge of C++ needed

• Topics Of C :
• Functions
• Pointers
• Structures
What Is Data Structure ?
• A way of storing and organising the data in computer’s memory.

• To understand this more clearly , lets’ take a simple non technical


example , shown in the next slide
What Is Data Structure ?
• Given a basket of fruits and vegetables , how would you
find/search apples and oranges in it ?

• As you can observe , since the basket is unorganized , it seems to


be very difficult for us to find our items.
What Is Data Structure ?
• Now have a look at the arrangement of fruits and vegetables
shown below and think again about the task?

• As you can observe , since the food items are now organized , it
seems to be very easy for us to find our items.
What Is Data Structure ?
• So , what we have done in the second way ?

• We have simply taken fruits and vegetables from the first messy
basket and organized them in a proper way .
What Is Data Structure ?
• The same concept applies to data structures .

• Here also we are given some data and we have to do some


processing on it.

• So before processing the data we organize this data in such a way


that we can easily access/ process/operate on this data.
What Is An Algorithm?
• A set of rules to follow to solve a particular problem.

• Example: Suppose we want to prepare SALAD for lunch.


What Is An Algorithm?

STEPS or SET OF RULES TO SOLVE A PROBLEM


Examples Of DS In Real Life
• People at ATM for cash withdrawal

Impossible to operate the ATM Very manageable , as


people are in a QUEUE
Examples Of DS In Real Life
• Air Connectivity Map Of India
Suppose we need to go to
Coimbatore from Delhi.

Very difficult to calculate


the OPTIMUM PATH
manually

Very easy if we convert it


Into a GRAPH and use
SHORTEST PATH
Types Of Data Structure
Linear V/s Non Linear
• A data structure is said to be Linear if its elements are connected
in such a SEQUENTIAL WAY .

• That is , after one element we have just one more element in


memory .

• Just like a HUMAN CHAIN


Linear V/s Non Linear
Linear V/s Non Linear

• Nonlinear data structures are those data structure in which data


items are not arranged in sequential manner.

• The data elements are present at different levels and there are
different paths for an element to reach the other element.

• Just like DAHI HANDI GOVINDAS


Linear V/s Non Linear
Google Interview Question
• Write a function that takes 2 arrays as argument and returns
TRUE if they have any element in common otherwise it should
return FALSE

• For example:
• int [ ] arr={6,2,11,8,5};
• int [ ] brr={7,1,15};
• For the above 2 arrays FALSE should be returned

• int [ ] arr={9,4,12,6,5,14};
• int [ ] brr={3,14,8,12};
• For the above 2 arrays TRUE should be returned
Course Outline
STACK
Introduction To Stack

Where Stack Is Used ?

Stack Operations : PUSH , POP, PEEP

Implementing Stack In Java Language

Applications Of Stack

Converting INFIX to POSTFIX and PREFIX

Evaluating INFIX
Course Outline
QUEUE
Introduction To Queue

Linear Queue

Drawbacks Of Linear Queue

Circular Queue

Priority Queue

Doubly Ended Queue

Applications Of Queue
Course Outline
LINKED LIST
Introduction To Linked List

Static V/s Dynamic Allocation

Why We Need A Linked List ? ( Drawbacks Of Array)

Linear Linked List

Implementation

Adding , Searching , Displaying Nodes Of A Linked List

Remove Nodes From A Linked List


Course Outline
CIRCULAR LINKED LIST
Introduction To Circular Linked List

Why We Need A Circular Linked List ?

Implementation

Adding , Searching , Displaying Nodes Of A Circular Linked List

Remove Nodes From A Circular Linked List

Various Interview Problems On Circular And Linear Linked List

Polynomial Representation Using Linked List


Course Outline
DOUBLY LINKED LIST
Introduction To Doubly Linked List

Why We Need A Doubly Linked List ?

Implementation

Adding , Searching , Displaying Nodes Of A Doubly Linked List

Remove Nodes From A Circular Linked List

Various Interview Problems On Doubly Linked List

Linked Implementation Of Stack & Queue


Course Outline
TREE
Introduction To Tree

Why We Need Tree ?

Understanding Binary Tree

Types Of Binary Tree

Different Types Of Binary Tree

Different Ways Of Representing Binary Tree In Memory

Creating A BST
Course Outline
TREE OPERATIONS
Introduction To Tree Traversal

Preorder , Inorder and Postorder Traversal

Implementing Tree Traversal

Deletion In A Binary Tree

Introduction To Heap

Adding , Deleting Data In Heap

Introduction To AVL Tree


Course Outline
GRAPH
Introduction To Graph

What & Why Of Graph

Graph Terminologies

Graph Representations : Adjacency Matrix & Adjacency List

Graph Traversals: BFS & DFS

Single Pair & All Pair Shortest Path

Spanning Tree
Course Outline
RECURSION
Introduction To Recursion

Why Recursion Is Important ?

Recursion V/s Iteration

How Recursion Works Internally ?

Examples Of Recursion

Types Of Recursion

When To Use/Avoid Recursion ?


Course Outline
COMPLEXITY ANALYSIS
Algorithm Runtime Complexity Analysis

Why Analysis Is Important ?

Types Of Complexity Analysis

How To Calculate Complexity Of An Algorithm ?


Course Outline
SEARCHING & SORTING
Searching Techniques

Linear & Binary Search

Sorting

Types Of Sorting : In place , Outplace , Stable & Unstable

Bubble Sort, Insertion Sort, Selection Sort

Quick Sort, Heap Sort, Merge Sort

Why So Many Sorting Techniques Are There ?


Next Class. . .

• Next class will be on Saturday , 2nd Dec @ 7:30 PM

• For any query ,please feel free to call at :

• 7314853128
• 7870554215
• 9826686245

You might also like