Code Monkey home page Code Monkey logo

niranjan-nagaraju / development Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 2.78 MB

Contains miscellaneous source code of my solutions to Hackerrank, Codechef, Project Euler problems and a library of useful code fragments

Home Page: http://www.vinithepooh.in

Haskell 5.20% Python 77.08% Emacs Lisp 0.18% Makefile 1.79% Assembly 0.08% Shell 0.51% C++ 5.22% C 6.76% Java 0.13% TeX 0.07% PHP 0.02% HTML 0.01% Yacc 0.03% Jupyter Notebook 0.13% Rust 2.13% Scala 0.25% Vim Script 0.33% BitBake 0.09%
data-structures algorithms hackerrank codechef project-euler leetcode design interviewbit functional-programming

development's Introduction

Contains miscellaneous source code of my solutions to Codechef, Project Euler and a library of useful code fragments.

development's People

Contributors

niranjan-nagaraju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

development's Issues

Incorrect handling of visited[] grids

self.dungeon[i][j][k] = '#'; bfs_q.append(((i-1, j, k), t+1)) if (i-1 >= 0 and self.dungeon[i-1][j][k] != '#') else None
self.dungeon[i][j][k] = '#'; bfs_q.append(((i+1, j, k), t+1)) if (i+1 < self.l and self.dungeon[i+1][j][k] != '#') else None
# Enqueue left, right, top, below grids in the same level
self.dungeon[i][j][k] = '#'; bfs_q.append(((i, j-1, k), t+1)) if (j-1 >= 0 and self.dungeon[i][j-1][k] != '#') else None
self.dungeon[i][j][k] = '#'; bfs_q.append(((i, j+1, k), t+1)) if (j+1 < self.r and self.dungeon[i][j+1][k] != '#') else None
self.dungeon[i][j][k] = '#'; bfs_q.append(((i, j, k-1), t+1)) if (k-1 >= 1 and self.dungeon[i][j][k-1] != '#') else None
self.dungeon[i][j][k] = '#'; bfs_q.append(((i, j, k+1), t+1)) if (k+1 < self.c and self.dungeon[i][j][k+1] != '#') else None

Incorrect handling of visited[] grids.
Copy-paste error: BFS sets the parent vertex/grid as visited repeatedly instead of the child vertices/grids while enqueueing.

Fix build for mac/clang

Current builds default to gcc.
clang doesn't support gcc-based '-dylib'.

[13:29:10 array]$ make
mkdir -p out/mac
gcc -fPIC -O2 -I./include -I../../../common/include -c src/array_queue.c -o out/mac/array_queue.o
gcc -fPIC -O2 -pthread -D_MULTI_THREADED_ -I./include -I../../../common/include -c src/array_queue.c -o out/mac/array_queue_mt.o
ar rcs out/mac/libarray_queue.a out/mac/array_queue.o
gcc -shared -fPIC -dylib -flat_namespace -undefined suppress -o out/mac/libarray_queue.dylib out/mac/array_queue.o -lgcc
clang: warning: argument unused during compilation: '-dylib' [-Wunused-command-line-argument]
ld: library not found for -lgcc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [array_queue] Error 1
make: *** [array_queue] Error 2

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.