Skip to content
CodeMarvels
All's the Code !
  • Home
  • Privacy Policy
  • About

Category: Algorithms

Algorithms

N Queens Problem (Backtracking)

Posted on July 14, 2013 by saurabh / 0 Comment

Given a chess board of size n*n,the task is to find all the ways to place n queens so that they don’t attack each other. In chess, a queen can move as far...

Algorithms

Sieve of Eratosthenes

Posted on July 10, 2013 by saurabh / 0 Comment

The task is to find all the primes between 1 to N.Numbers are called prime if they do not have any factors other than 1 and the number itself. Brute Force- Each...

Algorithms

Merge Sort

Posted on July 10, 2013 by saurabh / 0 Comment

Merge Sort is an example of a divide and conquer algorithm. A Divide and Conquer algorithm solves a problem using following three steps- 1. Divide: Break the gi...

Algorithms

Floyd Warshall Algorithm

Posted on July 8, 2013 by saurabh / 0 Comment

The problem is to find shortest distances between every pair of vertices in a given edge weighted directed graph. The graph is represented in the form of an adj...

Algorithms

Largest Sum Contiguous Subarray

Posted on July 7, 2013 by saurabh / 1 Comment

We have a sequence of integers and we need the maximum sum from the continuous sub-sequences. Example- Let the sequence of integers be (3,-4,5,-7,8,-6,21,-14,-9...

Algorithms

Subarray with given sum

Posted on July 7, 2013 by saurabh / 0 Comment

Given a list of integers,our task is to find if a sub-sequence which adds to a given number exists or not. Example- The given list is (1,4,20,5,5) and the given...

Algorithms

Binary Search

Posted on July 5, 2013 by saurabh / 0 Comment

This is a short note on using binary search, in continuance of my series on Algorithms. Suppose we have to find whether a particular element exists in the sorte...

Algorithms

Best Code to find n to the power k(n^k)

Posted on July 4, 2013 by saurabh / 0 Comment

To find n^k,using brute force, ALGORITHM- Initialize result to 1. Iterate from 1 to k and multiply n to result. Return result. CODE- result=1; for(i=1;i<=k;i...

Algorithms

Tips & Tweaks when programming Math !

Posted on July 4, 2013 by saurabh / 0 Comment

In this post,I am going to tell you some tips and tricks which you should know & you can implement in your codes if required.You dont need to require long c...

Algorithms/Technology

Insertion sort in Java

Posted on June 22, 2013 by Kj / 0 Comment

Here is a sample code for inserstion sort. The basic approach is to keep a pivot up to which the list is sorted. Insert the value (initially at the pivot) at th...

Posts navigation

« Previous 1 2 3

Recent Posts

  • Fix : Docker node down after restart
  • IP Telephony – bit rates of audio formats, and other notes
  • Fix: Cannot start container Subnet sandbox join failed error from docker
  • React Ajax call on load gives : “Error: Should not already be working.”
  • Fix : The repository ‘http://archive.ubuntu.com/ubuntu disco-backports Release’ no longer has a Release file.

Categories

  • Algorithms
  • Android Development
  • BoshServlet
  • C++ projects
  • Code Philosophies
  • Conversational AI
  • Machine Learning
  • Miscellaneous
  • Notes
  • Society
  • Technology

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© 2021 CodeMarvels
Powered by WordPress | Theme: Graphy by Themegraphy