SlideShare a Scribd company logo
1 of 36
There’s more to life
than lists.
/INTRO TO DS
& ALGOS
INTRO TO DS &
ALGOS
BECKHAM WEE
NIRWAN SARANG
INDEX.HTML
<WELCOME!>
FRESHMORES CURIOUS ABOUT DDW & CS
YEAR 2+ STUDENTS WHO NEED A REFRESHER
FOR TECHNICAL INTERVIEWS
/DATA STRUCTURES
/01 /ALGORITHMS
/02
/WIN SOME
VOUCHERS
/03
/WHAT TO EXPECT
INTRO TO DS &
ALGOS: CONTENT
1. Queues
2. Stacks
3. Linked Lists
<Data
Structures>
DATA STRUCTURES
/WHY?
> Save time
> Designing efficient algorithms
> Easier manipulation of data
INDEX.HTML
/Interview Questions
Use of appropriate data structures to
manipulate data in the context of the question
given
DATA STRUCTURES:
STACKS
<Stacks>
DATA STRUCTURES:
STACKS
<Stacks>
/STACK
> LIFO (Last in, First out)
> Reversing the order of insertion
DATA STRUCTURES:
STACKS
/STACK: IMPLEMENTATION
1.POP
2.PUSH
3.PEEK
4.SIZE (optional)
5.ISEMPTY (optional)
DATA STRUCTURES:
STACKS
DATA STRUCTURES:
QUEUES
<Queues>
DATA STRUCTURES:
QUEUES
<Queues>
/QUEUE
> FIFO (First in, First out)
> Controlling computer processes
DATA STRUCTURES:
QUEUE
/QUEUE: IMPLEMENTATION
1.ENQUEUE
2.DEQUEUE
3.SIZE (optional)
4.ISEMPTY (optional)
DATA STRUCTURES:
QUEUES
DATA STRUCTURES:
LINKED LISTS
<Linked
Lists>
DATA STRUCTURES:
LINKED LISTS
<Nodes>
Raphael Bryce Miguel Beckham
DATA STRUCTURES:
LINKED LISTS
<Linked List>
/LINKED LIST
> EACH ITEM IN THE LIST POINTS TO
ANOTHER ITEM
> Scavenger Hunt
DATA STRUCTURES:
LINKED LISTS
/LINKED LISTS: IMPLEMENTATION
> NODE CLASS
1.getData
2.getNext
3.setData
4.setNext
DATA STRUCTURES:
LINKED LISTS
/LINKED LISTS: IMPLEMENTATION
> LinkedList
1.ADD
2.REMOVE
3.ISEMPTY
4.SIZE
5.SEARCH
DATA STRUCTURES:
LINKED LISTS
1. Bubble sort
2. Insertion sort
3. Quick sort
4. Merge sort (Optional)
<Sorting
algorithms>
INDEX.HTML
/Interview Question/DDW
Explain and code out a certain sorting
algorithm.
Compare the performance of different sorting
algorithms.
/Insertion sort
INDEX.HTML
O(n^2) (Quadratic)
/Bubble sort
O(n^2) (Quadratic)
/Time complexities
/Quick sort
O(n^2) (Quadratic) → Worst case
O(n log n) (Logarithmic) -> Average
Bubble sort
<Bubble
sort>
Bubble sort
/Bubble sort
Bubble sort is one of the simplest algorithms and works by repeatedly
swapping the adjacent elements if they are in wrong order.
1st step
[7,5,9,0,3] —> [5,7,9,0,3]
2nd step
[5,7,9,0,3] —> [5,7,9,0,3]
3rd step
[5,7,9,0,3] —> [5,7,0,9,3]
4th step
[5,7,0,9,3] —> [5,7,0,3,9]
9 has “bubbled” up to the end of the array. Hence, bubble sort.
After iterating the highest number will bubble to the top of the array.
(Depends on the way the algorithm is implemented, either the highest
number goes to the back or the smallest number comes to the front)
Insertion sort
<Insertion
Sort>
Insertion sort
/Insertion sort
Fun fact: Insertion sort can sort arrays as it receives the elements, which
makes it a good algorithm for the internet if you receive real time data that
needs sorting (Don’t ask me how).
Insertion sort divides the array to two segments → sorted and unsorted segments
1st step
[11,-69,25,0,86,12,6] → [-69,11,25,0,86,12,6]
2nd step
[-69,11,25,0,86,12,6] → [-69,11,25,0,86,12,6]
3rd step
[-69,11,25,0,86,12,6] → [-69,0,11,25,86,12,6]
4th step
[-69,0,11,25,86,12,6] → [-69,0,11,25,86,12,6]
5th step
[-69,0,11,25,86,12,6] → [-69,0,11,12,25,86,6]
6th step
[-69,0,11,12,25,86,6] → [-69,0,6,11,12,25,86]
Quick sort
<Quick
Sort>
Quick sort
/Quick sort
Quick sort is also a divide and conquer algorithm which utilizing a pivot point (Item starting
from left > pivot, item starting from right < pivot)
[14,3,-56,42,56,21]
[-
56,3,14,42,56,21]
[-56,3,14] [42,56,21]
[21,42,56]
[-56,3,14,21,42,56]
Always remember, quicksort = pivot!
/Programming logic
Programming logic
/ Find unique integer
Given an array of positive integers. One integer is not
repeated while all others are repeated. Find the integer that
is not repeated.
Example: Input → [1,9,15,67,2,9,1,2,67] Output → 15 ( as 15
only appears once)
Programming logic
/ Rotate array
Given an array of integer numbers and a separate integer, n,
“rotate” the first n (0 <= n <= 10^5) elements in the array to
the end of the array.
Example: Input → [1,2,3,4,5,6], n = 2 Output → [3,4,5,6,1,2]
INDEX.HTML
/Basic dynamic programming
Memoization → It’s a “top-down” problem solving method
where the code stores the outputs of certain inputs thus
increasing the efficiency of future computations.
Dynamic
Programming
/Fibonacci Sequence
Create a function that takes in an integer argument and
recursively outputs the corresponding fibonacci sequence
number.
Example: Input —> n = 5, Output = 5
Input –> n = 8, Output = 21
PLS DO THIS
<SURVEY!>
Email/Telegram/Teams
https://forms.office.com/r/z7WnedHUDh
CREDITS: This presentation template was created by Slidesgo,
including icons by Flaticon, and infographics & images by
Freepik
/THANKS!
/3DC
3dc@club.sutd.edu.sg
BYE BYE
● https://m.media-amazon.com/images/I/81btrHKgO0L.jpg
● https://www.stickpng.com/img/objects/book/book-stack
● https://runestone.academy/ns/books/published/pythonds/_images/orderlinkedlist.png
● https://alchetron.com/cdn/east-west-mrt-line-06674440-b858-44f7-bd29-b844e290790-resize-750.gif
References (Images)

More Related Content

Similar to 3DC DS Algo Workshop.pptx

Introducing ms sql_server_updated
Introducing ms sql_server_updatedIntroducing ms sql_server_updated
Introducing ms sql_server_updated
leetinhf
 
The thinking persons guide to data warehouse design
The thinking persons guide to data warehouse designThe thinking persons guide to data warehouse design
The thinking persons guide to data warehouse design
Calpont
 
Most useful queries
Most useful queriesMost useful queries
Most useful queries
Sam Depp
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
EliasPetros
 

Similar to 3DC DS Algo Workshop.pptx (20)

Oracle Database 12c - Data Redaction
Oracle Database 12c - Data RedactionOracle Database 12c - Data Redaction
Oracle Database 12c - Data Redaction
 
Non-Relational Postgres
Non-Relational PostgresNon-Relational Postgres
Non-Relational Postgres
 
Introducing ms sql_server_updated
Introducing ms sql_server_updatedIntroducing ms sql_server_updated
Introducing ms sql_server_updated
 
Checking clustering factor to detect row migration
Checking clustering factor to detect row migrationChecking clustering factor to detect row migration
Checking clustering factor to detect row migration
 
Oracle Data Redaction
Oracle Data RedactionOracle Data Redaction
Oracle Data Redaction
 
DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018
DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018
DATA BASE || INTRODUCTION OF DATABASE \\ SQL 2018
 
The thinking persons guide to data warehouse design
The thinking persons guide to data warehouse designThe thinking persons guide to data warehouse design
The thinking persons guide to data warehouse design
 
SQL – A Tutorial I
SQL – A Tutorial  ISQL – A Tutorial  I
SQL – A Tutorial I
 
Intro to SQL for Beginners
Intro to SQL for BeginnersIntro to SQL for Beginners
Intro to SQL for Beginners
 
Bt0075, rdbms and my sql
Bt0075, rdbms and my sqlBt0075, rdbms and my sql
Bt0075, rdbms and my sql
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Geek Sync I Polybase and Time Travel (Temporal Tables)
Geek Sync I Polybase and Time Travel (Temporal Tables)Geek Sync I Polybase and Time Travel (Temporal Tables)
Geek Sync I Polybase and Time Travel (Temporal Tables)
 
Bt0075, rdbms and my sql
Bt0075, rdbms and my sqlBt0075, rdbms and my sql
Bt0075, rdbms and my sql
 
Most useful queries
Most useful queriesMost useful queries
Most useful queries
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
 
Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre FeaturesLinuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
 
Managing user Online Training in IBM Netezza DBA Development by www.etraining...
Managing user Online Training in IBM Netezza DBA Development by www.etraining...Managing user Online Training in IBM Netezza DBA Development by www.etraining...
Managing user Online Training in IBM Netezza DBA Development by www.etraining...
 
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
 
MSBI with SQL Server T-SQL | Microsoft BI With Server T-SQL | Realtime Traini...
MSBI with SQL Server T-SQL | Microsoft BI With Server T-SQL | Realtime Traini...MSBI with SQL Server T-SQL | Microsoft BI With Server T-SQL | Realtime Traini...
MSBI with SQL Server T-SQL | Microsoft BI With Server T-SQL | Realtime Traini...
 
SAS/Tableau integration
SAS/Tableau integrationSAS/Tableau integration
SAS/Tableau integration
 

Recently uploaded

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 

Recently uploaded (20)

TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 

3DC DS Algo Workshop.pptx

Editor's Notes

  1. Book stacking imagery speech
  2. Book stacking imagery speech
  3. Last in first out Fundamentally important when you want to reverse the order of insertion, common day applications are simulation of cafeteria trays etc
  4. Explain each function, open source code
  5. Queueing up at a cafeteria imagery
  6. Queueing up at a cafeteria imagery
  7. FIFO Commonly used in computer processes, e.g. printer queues
  8. Explain each function, open source code for Stack
  9. FIFO Commonly used in computer processes, e.g. printer queues
  10. Explain each function, open source code for Stack
  11. Explain each function, open source code for Stack