Giter Site home page Giter Site logo

jakubner / cpp_tree_field_solution Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mahmadij/cpp_tree_field_solution

0.0 1.0 0.0 18.05 MB

The solution to find the biggest rectangular area in a treed field which contains no tree. Written in C++.

C++ 100.00%

cpp_tree_field_solution's Introduction

This is an update on someone else's solution to a fun problem.

A certain group of devs were challenging themselves to create the fastest solution to a problem.

I didn't come up with my own solution, just made one of the other dev's solution faster.

Original Problem

Given a “Field of Trees”, find the largest rectangle inside it that has no trees.

The field is X x X.

There are X trees scattered around the field ( but not touching the edge ).

You want to build a house ( or a soccer field, or something ) without cutting down any trees.

Find the largest rectangle ( by area ) that you can fit between the trees.

Original Solution

The original solution by mahmadij@github:

https://github.com/mahmadij/cpp_tree_field_solution

My Hacks

My hacks to the solution included.

  • cleanup of headers
  • using stdlib qsort instead of a custom bubble sort
  • using four threads instead of one (although I still resorted the whole field in each thread)

For each run I output the result of the original, qsorted one thread solution, and the four thread solution.

cpp_tree_field_solution's People

Contributors

mahmadij avatar jakubner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.