Skip to content

Learn & Lead

Man is still the most extraordinary computer of all

Menu
  • Home
  • Algorithms
    • Sorting Algorithms
    • String Algorithms
    • Kadane’s Algorithm
  • Computer Graphics
    • Lab 1 – Print Green Window
    • Lab 2 – Sierpinski Triangle
    • Lab 3 – Two Dots
    • Lab 4 – Square in Square
    • Lab 5 – Qaudrilateral
    • LAB 6- e^(-x)*cos(2*x*π ) Graph
    • Lab 7 – sin(x)/x Graph
    • Lab 8 – Dot on Click
    • Lab 9 – (i) Chess Board
    • Lab 9 – (ii) Colored Chess Board
    • Lab 10 – Freehand Drawing
    • Lab 11 – Mouse Click Polyline
    • Lab – 12. Color Freehand Drawing
  • Data Structures
    • Linked List
    • Queues
    • Stacks
    • Trees
  • Networking
    • Linux Assembly Language Premier
      • Part – 1 System Organization
      • Part – 2 Virtual Memory Organization
    • Socket Programming
      • Socket Programming – Part 1
      • Socket Programming – Part 2
    • TCP Client program in C language
    • TCP Server program in C language
    • UDP Client program in C language
    • UDP Server program in C language
  • About Me

Month: October 2013

Posted onOctober 30, 2013September 23, 2015Computer Graphics

Computer Graphics – Lab 19 Line with Stipple Patterns

by RobinLeave a comment on Computer Graphics – Lab 19 Line with Stipple Patterns

[wpdm_package id=’1256′] Sample Input – Write a program to draw line with stipple patterns. Sample Output – [sourcecode lang=”cpp”] glEnable(GL_LINE_STIPPLE); glLineStipple(1,0x00ff); glBegin(GL_LINES); glVertex2f(100,100); glVertex2f(600,600); glEnd();…

Read More
Posted onOctober 20, 2013September 23, 2015Algorithms

Check if two Trees are Structurally Similar

by RobinLeave a comment on Check if two Trees are Structurally Similar

[wpdm_package id=’1352′] Algorithm: Use Recursion. If both the trees are NULL, return true. If only one of the trees is NULL return false. Recursively find…

Read More
Posted onOctober 10, 2013September 23, 2015Algorithms

How to Delete a Tree

by RobinLeave a comment on How to Delete a Tree

[wpdm_package id=’1354′] Algorithm: [sourcecode lang=”cpp”] void DeleteBinaryTree(tree_node *root) { if(!root) return; DeleteBinaryTree(root->left); DeleteBinaryTree(root->right); free(root); } [/sourcecode]

Read More
Posted onOctober 9, 2013September 23, 2015Algorithms

Check if two Trees are Mirrors of each other

by RobinLeave a comment on Check if two Trees are Mirrors of each other

[wpdm_package id=’1359′] Algorithm: Return true if both the trees are empty. Return false if only one of the tree is empty. Return false if root…

Read More
Posted onOctober 7, 2013September 23, 2015Algorithms

Find the level with Maximum Sum in a Binary Tree

by RobinLeave a comment on Find the level with Maximum Sum in a Binary Tree

[wpdm_package id=’1361′] Algorithm: [sourcecode lang=”cpp”] int FindLevelWithMaxSum() { tree_node *temp; int level=0, maxLevel=0; std::queue<tree_node *> Q; int currentSum=0, maxSum=0; if(!root) return 0; Q.push(root); Q.push(NULL); while(!Q.empty())…

Read More
Posted onOctober 6, 2013September 23, 2015Algorithms

How to Mirror a Binary Tree

by RobinLeave a comment on How to Mirror a Binary Tree

[wpdm_package id=’1363′] Algorithm: Use Recursion. Find the left node and corresponding right node each time using recursion. Swap the nodes. [sourcecode lang=”cpp”] void MirrorOfBinaryTree(tree_node *root)…

Read More
Posted onOctober 3, 2013Algorithms

Implement 2 Stacks using 1 Array

by RobinLeave a comment on Implement 2 Stacks using 1 Array

Question – How do we implement 2 Stacks using 1 Array? One stack routines should not show a exception unless every slot in array is…

Read More
Posted onOctober 2, 2013September 23, 2015Algorithms

Print the Root-to-Leaf Paths in a Binary Tree

by RobinLeave a comment on Print the Root-to-Leaf Paths in a Binary Tree

[wpdm_package id=’1365′] Algorithm: Use Recursion. Store the data in each path in an array while you traverse. Traverse the left subtree and the right subtree.…

Read More
Posted onOctober 1, 2013September 23, 2015Algorithms

Find the Height of a Binary Tree

by RobinLeave a comment on Find the Height of a Binary Tree

[wpdm_package id=’1349′] Algorithm: Use recursion. Find the height of the left subtree. Find the height of the right subtree. Check which is maximum. The maximum…

Read More
Posted onOctober 1, 2013September 23, 2015Algorithms

SAP Labs Coding Interview Question 1

by Robin8 Comments on SAP Labs Coding Interview Question 1

[wpdm_package id=’1421′] Question – Reverse a string Conditions – i. I have to reverse word by word. ii. When I reverse a word the Last…

Read More

Categories

  • Abroad Studies
  • Algorithms
  • Android
  • Bitwise Programming
  • Computer Graphics
  • Conference Paper
  • Data Structures
  • How to do?
  • Interview
  • Linux
  • Netcentric Programming
  • Networking
  • Open Source
  • Operating Systems
  • Parallel system Architecture
  • Technology
  • Uncategorized
  • Web Development

Archives

  • April 2020
  • May 2019
  • December 2016
  • November 2016
  • September 2016
  • August 2016
  • April 2015
  • September 2014
  • August 2014
  • April 2014
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013

Recent Comments

  • priya on SAP Labs India hires me!!
  • robin on SAP Labs India hires me!!
  • robin on Simple Login Authentication Application with Session using JSP / JSTL
  • robin on SAP Labs India hires me!!
  • robin on SAP Labs Coding Interview Question 1
Amphibious Theme by TemplatePocket ⋅ Powered by WordPress