Topic — Add New » Posts Last Poster Freshness
binary search tree 1 1 month

Help! My home work is to create a binary search tree with integers.

The program below print out inorder, preorder, postorder traversals. How do I code to get number of leaf nodes, number of nodes with one child, number of nodes with two child, max and min leaf nodes, height of tree and if the tree is balanced?

_____________________________________________________

#include <iostream>
using namespace std;

const int nil = 0;
class treenode_type ...

WHICH ONE IS MORE EFFICENT FOR B-TREE? 3 2 months

WHICH ONE IS MORE EFFICENT FOR B-TREE
1)INSERTION
2)DELETION
3)SEARCHING
4)FIND MAX AND MIN

A B Tree question 2 kartik 2 months

what is use of B-tee
1)reduce time complexity
2)reduce space complexity
3)both
4)none

implement a stack (push and pop) using binary search tree 5 3 months

how to implement a stack (push and pop) using binary search tree??

Insertion in Binomial Heap 1 4 months

Hello, everyone! I am new to GeeksforGeeks and I would like a little help in implementing Binomial Heap subroutines in C, especially insertion in Heap. For my application it is necessary to implement max-heaps(i.e., roots storing the maximum value) in stead of min-heaps(i.e., root storing minimum value) in ANSI C. I have written a few subroutines - but things are not working properly. I will explain my codes here with code snippet and my problem.

struct _tnode{
	int key;//a field k...
Replace root value with the sum of left and right node value for every nodes 3 shashi_kumar 6 months

A binary tree is given. Write a C code such that the code should put the sum of left and right nodes at root for every nodes of the tree.

Ancestor of two given leaf nodes 6 6 months

Determine the first common ancestor of twi given leaf nodes in Binary Tree.

Amazon Interview Question for Software Engineer/Developer (Fresher) 6 gaurav 6 months

Given a binary tree write efficient code to make it balance binary tree..interview wants from me clear code & appropach

Amazon
Microsoft Interview Question for Software Engineer/Developer about Puzzle 6 tapan.k.avasthi 7 months

You have a bucket of jelly beans. Some are red, some are blue, and some green. With your eyes closed, pick out 2 of a like color. How many do you have to grab to be sure you have 2 of the same?

Microsoft
Print a binary tree in zigzag manner. 4 7 months

Print a binary tree in zigzag manner.

k-d tree applications 2 8 months

plz tell me the applications of k-d trees and how can i apply search operation in it.

Print even numbered levels starting from last-level. 1 9 months

A 3 –ary tree consists of two data fields: name and Age. Design an algorithm for viewing the contents of all even numbered levels starting from last-level. In a level display all nodes from right to left. Root is at level 0.

Digital search tree 1 9 months

Hello everyone
I have very brief idea about digital search tree .
how does it works actually..please help me!!

interview question about BST 3 10 months

You are given a binary search tree and a number k. Write an algorithm that that gives all pairs of nodes p and q in the tree such that p+q=k.

converting n*n matrix representation of a binary tree to array representation 1 abhay 10 months

We have give n*n matrix (having values as 1 or 0) which represents binary tree. if matrix[i][j] == 1 then j is parent of i we have to convert that matrix into array representation of tree

Array representation of tree means tree is stored in a array such that a[2*n] and a[2*n+1] are children of node n.

We have to convert n*n 2D matrix representation of tree to 1D matrix of size 2^n-1.

i/p

0 0 0 0 1
0 0 0 0 1
0 1 0 0 0
1 0 0 0 0
0 0 0 0 0

...
student Interview Question for Other (0 - 2 Years) about Data Structure 2 itspankaj 10 months

Merge two BST into One.
BST t2 is merged into BST t1.

student