Programming

Thursday, 11 July 2013

How to check if two given line segments intersect?

›
Given two line segments (p1, q1) and (p2, q2), find if the given line segments intersect with each other. Before we discuss solution, le...
Tuesday, 9 July 2013

Given a set of numbers, find the Length of the Longest Arithmetic Progression (LLAP) in it.

›
Example: set[] = {1, 7, 10, 15, 27, 29} output = 3 The longest arithmetic progression is {1, 15, 29} For simplicity, we have assumed th...
Friday, 5 July 2013

Ciel and Dancing

›
http://codeforces.com/problemset/problem/322/A Fox Ciel and her friends are in a dancing room. There are n boys and m girls here, and ...
Monday, 17 June 2013

create a BST from a given level order traversal

›
ALGORITHM: The first elenment is the root.All elements less than first element in the level order traversal belong to left subtree and app...
Monday, 10 June 2013

Design a stack with operations on middle element

›
How to implement a stack which will support following operations in O(1) time complexity ? 1) push() which adds an element to the top of ...
1 comment:
Sunday, 2 June 2013

Program to count leaf nodes in a binary tree

›
getLeafCount(node) 1) If node is NULL then return 0. 2) Else If left and right child nodes are NULL return 1. 3) Else recursively calculate...
Friday, 31 May 2013

Find The Maximum Sum in Triangle From Top to Bottom (Euler Problem).

›
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23...
3 comments:
‹
›
Home
View web version

About Me

HIMANGI SARAOGI
View my complete profile
Powered by Blogger.