SlideShare une entreprise Scribd logo
1  sur  3
Avid TV Watcher<br />Problem:<br />There is a TV avid person, who wants to spend his maximum time on TV. There are N channels that telecast programs of different length at different timings. WAP to find the program and channel number so that the person can spend his max time on TV.<br />Algorithm:<br />,[object Object]
n ←  length(prog) - 1
for i ← 1 to n

Contenu connexe

Plus de Akash Agrawal (13)

Leadership Lessons Learnt
Leadership Lessons LearntLeadership Lessons Learnt
Leadership Lessons Learnt
 
AWS Cost Cheat Sheet
AWS Cost Cheat SheetAWS Cost Cheat Sheet
AWS Cost Cheat Sheet
 
VIM for Programmers
VIM for ProgrammersVIM for Programmers
VIM for Programmers
 
Cloud computing @ slideshare
Cloud computing @ slideshareCloud computing @ slideshare
Cloud computing @ slideshare
 
Expenditure For Anna Hazare Movement
Expenditure For Anna Hazare MovementExpenditure For Anna Hazare Movement
Expenditure For Anna Hazare Movement
 
Donation For Anna Hazare Movement in 2010 12
Donation For Anna Hazare Movement in 2010 12Donation For Anna Hazare Movement in 2010 12
Donation For Anna Hazare Movement in 2010 12
 
Auto scaling
Auto scalingAuto scaling
Auto scaling
 
Call Forwarding
Call ForwardingCall Forwarding
Call Forwarding
 
Work Culture
Work CultureWork Culture
Work Culture
 
HUM-TUM
HUM-TUMHUM-TUM
HUM-TUM
 
Day13-Akash
Day13-AkashDay13-Akash
Day13-Akash
 
Day12 - Akash
Day12 - AkashDay12 - Akash
Day12 - Akash
 
ALEKH
ALEKHALEKH
ALEKH
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Avid tv watcher

  • 1.
  • 2. n ← length(prog) - 1
  • 3. for i ← 1 to n
  • 6. j ← 0
  • 7. while prog[j].end < prog[i].start
  • 8. if max < prog[j].cnt
  • 9. do max ← proj[j].cnt
  • 10. j ← j + 1
  • 11. do prog[i].cnt ← max + prog[i].end – prog[i].start
  • 13. for i ← 1 to n
  • 14. if res < prog[i].cnt
  • 15. do res ← prog[i].cnt
  • 16. return resExample:<br />Channel 1:<br />Program idP1P2P3Start time8:009:0010:30End time8:3010:0011:30<br />Channel 2:<br />Program idP4P5P6Start time8:159:3010:45End time9:1510:1511:15<br />Sort all programs based on their end time:<br />Cnt000000Pr idP1P4P2P5P6P3St time8:008:159:009:3010:4510:30End time8:309:1510:0010:1511:3011:30<br />1st Iteration:<br />Cnt00:3000000Pr idP1P4P2P5P6P3St time8:008:159:009:3010:4510:30End time8:309:1510:0010:1511:3011:30<br />2nd Iteration:<br />Cnt00:3001:000000Pr idP1P4P2P5P6P3St time8:008:159:009:3010:4510:30End time8:309:1510:0010:1511:3011:30<br />3rd Iteration:<br />Cnt00:3001:0001:30000Pr idP1P4P2P5P6P3St time8:008:159:009:3010:4510:30End time8:309:1510:0010:1511:3011:30<br />4th Iteration:<br />Cnt00:3001:0001:3001:4500Pr idP1P4P2P5P6P3St time8:008:159:009:3010:4510:30End time8:309:1510:0010:1511:3011:30<br />5th Iteration:<br />Cnt00:3001:0001:3001:4502:300Pr idP1P4P2P5P6P3St time8:008:159:009:3010:4510:30End time8:309:1510:0010:1511:3011:30<br />6th Iteration:<br />Cnt00:3001:0001:3001:4502:3002:45Pr idP1P4P2P5P6P3St time8:008:159:009:3010:4510:30End time8:309:1510:0010:1511:3011:30<br />