Hewlett-Packard
3.0 of 5 7,547 reviews
www.hp.com Palo Alto, CA 5000+ Employees

Hewlett-Packard Software Developer Interview Question

I interviewed in Yehud (Israel) and was asked:
"given a binary tree how would you mirrorreverse it"
Add Tags [?]
Answer Flag Question

Part of a Software Developer Interview Review - one of 1,358 Hewlett-Packard Interview Reviews

Answers & Comments

0
of 0
votes
struct node *mirror(struct node *here) {

  if (here == NULL)
     return NULL;
  else {

    struct node *newNode = malloc (sizeof(struct node));

    newNode->value = here->value;
    newNode->left = mirror(here->right);
    newNode->right = mirror(here->left);

    return newNode;
  }
- Greg on Mar 30, 2012 Flag Response

To comment on this question, Sign In with Facebook or Sign Up


Hewlett-Packard – Why Work for Us?

The start-up that started it all. Six decades before high tech and dot coms existed, classmates Bill Hewlett and Dave Packard built an audio oscillator in a garage and launched a technology revolution. Today we’re… Full Overview

Provided by employer [?]

Tags are like keywords that help categorize interview questions that have something in common.

Glassdoor is your free inside look at Hewlett-Packard interview questions and advice. All interview reviews posted anonymously by Hewlett-Packard employees and interview candidates.