You are on page 1of 25

case 3:

display();
}
}
return 0 I·
}

PROBLEMS OUTPUT TERMINAL DEBUG CONSOLE


12) Code + . ., 8 i ( X

PS C:\Users\Adith\Dropbox\Sem 3\DS-C\Code-playground> cd "c :\ Users


\Adith\Dropbox\Sem 3\DS-C\Code-playground\ 11
if ($? ) { gee circ_q
;

ue.c -o circ_que} ; if ( $? ) { .\circ_que }

Press 1: Insert an element


Press 2 : Delete an element
Press 3: Display the element
Enter your choice: 1
Enter the element which is to be inserted : 25

Press 1: Insert an element


/
Press 2: Delete an element
Press 3: Display the element
Enter your choice: 1
123
Enter the element which is to be inserted:

Press 1: Insert an element


Press 2: Delete an element
Press 3: Display the element
Enter your choice: 3

Elements in a Queue 23,


Press 1: Insert an el
Press 2: Delete an ement
Press 3: Display the. element
Enter your choice : 2

The dequeued element is 25


. --- - - - - .

P
p re ss 1 ·. 1n se rt an el
em en
P re ss 2: D el et e an el em t
re ss 3: D is p la y th e en t
E n te r el em en t
y o u r ch o ic e:
3
Elements i n a Queue
P re ss 1 ·. I n se ar e :123
rt an el em en t ,
P re ss 2: D el et e
an el em en t
:r e s s 3: D is p la
y th e el em en t
n te r y o u r ch o ic
e: 4
~
~
~
w--: '
(ri:a

-....-....
.,..
~


~
~

~
6r
~

~
.D,;.J. ,r._ --11'"°~...-o.M
- " - '- ( ) ~ o x f " " ' ~
.fYV'll' \~..>'ll< ~"'4 lb,

~ .,{ )J > . . t ~ 6'V\.


,t:,
.;~ iS1. v-JJ-'-1-, 61> ~ e t ' \
~

'
~
~""
o,J\J.. &J',,r,4
~~-
<To .u>9u"\e.. o- c, --V'"°fo.m. .:to . .f'Cll'(>lcm\~
~ ~cct,'e,- ~ ~ ~& .:to J'M~I~

~ ~~ ju.9tu, ~ · r 0 r 0-V\&. 11,1,-<>u'.>-

A~t:1t ()Q.\1'i\ M ..
- ~Q..p \~ ~
,uq, ,_ : \ Y\).~cfu"'u_ .0.. ~~ ,..XO.~ "°""'"1 "\-
.; (
,oo,
~~ ~ ~
~?-9-

M~ ; : IN.~7-t- J:lM ,.µo.MI<. ~o..t\


JJ.'\µ__ p\,l/W> l ')
1
fl OIJ) L ') oJl ~ <11, _M,\.O w I..) ,
1

~ 1-\ '. In ~ -t,-n~~ , uill ,Ui\J.. ~


¾<"'Ulirn. i;b:) ~~ . .A- ~.,,A,.,-
"
c.Q,p~e<). /\
~ f)" :. ENP ·~ / .
(

#include <std io . h>


int stac k[100], i, j, choice = 0, n, top = - 1;
void push ()
{
int val;
if (top == n)
prin tf ( "\n Overflow \n ");
else
{
prin tf ( "Enter the value?" );
scan f( "%d " , &val) ;
top = top + 1;
stac k[to p] = val;
}
}

void pop( )
{
if (top == - 1)
prin tf( "Underflow") ;
else
top = top - 1;
}
void show ()
{
for (i = top; i >= 0 ; i --)
{
prin tf( "%d\n " , stac k[i] );
}
if (top == - 1)
{
prin tf ( "Stack is empty" );
}
}
void main ()
{

prin tf ("Enter the number of elements in the stac k"


);
scanf ( 11 %d 11 1 &n);
prin tf( "*********Stack oper atio ns using array********
*" );
prin tf ("\n ---- ---- ---- ---- ---- ---- ---- ---- -- ---- ----
---- \n '' );
While (ch oic e ! = q)
{
s ... \n ");
pri ntf ("Chose one from the below opt ion
");
pri ntf (" \n l.P ush \n 2.Pop\ n3.Show\n Q.E xit
pri ntf (" \n Enter your choice \n ");
sca nf( %d " I &cho ice )·I
11

switch (ch oic e)


{
case 1:
{
push ();
break ;
}
case 2:
{
pop ();
break ;
}
cas e 3 :
{
show( );
break ;
}
cas e L.l :
{
pri ntf ("E xit ing ... . ");
break ;
}
def aul t :
{
val id ch oic e") ;
pri ntf ("P 7
}
};
}
}
sta ck 5
En ter the number of elements in the
********
*********Stack ope rat ion s using array*
------------ ----------------------------------
Chose one from the below opt ion s ...

1.P ush
2.Pop
3 . Sho l'I
LL Ex it
Enter your choice
l
Enter the value?l
Chose one from the below options.• ·

l.Push
2.Pop
3.Show
q.fxit
Enter your choice
1
Enter the value?2
Chose one from the below options . . .

1.Push
2.Pop
3.Show
q,Exit
Enter your choice
1
Enter the value?3
Chose one from the below options . . -.

I.Push
2.Pop
3.Show
LL Exit
Enter your choice
2
Chose one from the below options ...

l . Push
2.Pop
3 . ShOl'/
q,fxit
Enter your choice
3
2
1
Chose one from th e below op t·
1.Push ion s

2.Pop
3 .Show
ti.E xit
. Enter yo ur cho ice
, q

Ex itin g ... /

y
~) -\) SI O N;
-ro ..u ,~Q .. a.. c.. r ro.y(I .:,;;u .fr n " \ ~ ~~
~ ~ I o.,,,d ~ J' M '( '\~
!h .4 '~ o. .X I~
~ ..,0 f>~ oe -,i, . JJ ..~ -1'\AM"- ' 9o p 0-¥\d... ~ ~
~ ~ ~~--
. ··-
. .. - .

Al"1 '.

\0 ..u'.>"-'~ ~ CL
C -I'~"'" -"' :U> J,m'l;J\ex-f\RM l e ~
0
~ OY\~ ~ ~:n:xNVvl o-1. .::t a.~tM ~ vJ. .

.:to .x-m»eM-L- --'"'


.tUcz..p; ~
c.~a . CL ~~cm Q
.AV'I~ ,
...oJ.I
.0 ~
J . / ~ ~c\-u'U'\vJ.-
..y,~..- M lll'\cl · ..po.s-t:o'( &..v- .

0
_tQ,C.W'\A, u.9-A .

,.UII,\?., ·. t...-,o.A: Q. 0.. ~J__ :to :1w-'\-fo..tfu. a.,,<l.


,u,o-1: "ocb-- ~ ~ ~ o.,J... :,u°~
voh,..l. ~
I" CMoJ.
~ ~e:.,, c
e,o!9- ~ ~ "'°°"'-
t,-n !!¥17" ..o..ncl. J.~ ~ ~
. u ~ ~ o.J/\d,. b-oN eLU .., .

WO.
-
#include <stdio.h >
#include <stdlib. h>

struct node
{
int item;
struct node *left;
struct node *right;
};

void inorder Travers al (str uct node *root )


{
if (root = NULL)
return ;
inorder Travers al (root-> left);
printf( "%d ->" , root->i tem);
inorder Travers al (root-> right);
}

void preorde rTraver sal (struct node *root ) ·


{
if (root == NULL)
return ;
printf( "%d ->" , root->i tem);
preorde rTraver sal(roo t->left );
preorde rTraver sal (root-> right);
}

void postord erTrave rsal ( struct node *root )


{
if (root == NULL)
r et urn ;
postord erTr aversal (root-> left);
postord erTrave rsal (root-> right);
pr intf( "%d -> 11 1 root->i tem);
}

str uct node *createN ode ( int value )


{
struct node *newNode = mal l oc( sizeof( struct node)) ;
newNode->i tem = value ;
newNode->left = NULL·I
b\

newNode->right = NULL ;

return newNode;
}

struct node *insertleft( struct node *root , int value)


{
root->left = createNode (value);
return root->left;
}

struct node *insertRight (struct node *root , int value)


{
root->right = createNode ( value);
return root->right;
}

int main ()
{
struct node *root = createNode ( l );
insertLeft (root, 2);
insertRight (root, 3);
insertLeft (root->left, 4);

printf( "Inorder traversal \n 11 ) ;


inorderTraversal (root);

printf( "\n Preorder t versal

printf( "\n Postorder traversal \n ");


postorderTraversal(root);
}

,
)
:, _________________ ___________
;)
OO"rPUT
PROBLEMS ourour TER MINA L DEBUG CONSOLE I}) Code + v 8 ti)) < X

PS C:\Users\Adith\Dropbox\Sem
rs\Adith\Dropbox\Sem 3\DS-C\C ! \DS-C\Code-playground> cd ''c:\Use
11
nary_tree c _ b" 0 e-playground\ if ( $?) { g•b"
Inorder t;aversa:nary_tree}
0 ; if ( $? ) { . \bin;ry_tre~ } cc l
q ->2 ->1 ->3 ->
Preorder traversal
1 ->2 ->1' ->3 ->
Postorder traversal
1' ->2 ->3 ->1 ->
.
/
r

!"'°"'~ , p :,u.,o-(~ , (> 0 S t ()y~

(!I)(~ ~~·
~ '.I- : \ru'\-\'Cl.Jiu .A .-u-ru ck<-""'-'- \<)-r a. ..w,c9-,-,
..w~~ .do.;lo.._. ~ ~}~~
~ 3 ._ \~ifo.Qf ~ ..o.. ~u:lCJ\1\.- ~
~ ol ~"YO.tJ'e>JJ oi. ,A).JrtO'
~
.J,.~
-
~~o~
OI'\ .

..uo-r ~ •. \" lvlo.f"' t,,,~01\ J c,-..t <tw-- ~'ll'l'v.:l<


~ JM.v.xttri' J.,._ 0->'\ Q.W>'l'"'t G~~
~
,,-u..o.)\~ \:7\-U..·
~
Iv ~ 1, : . c.oJJ. ~ ~ O" ,(o-<
"' -0
I v,O(cuJ\.

'w
~ =
~().)J~~-

Q /1_,,,t- fV"lplM J.,,< PM b.,... ~ -


/4.XQ{> b ·. v'UV' ""' ,-
0, ,,u~" . S)~Cl o\W-- ~ <1.i"lc/.. ,__.,a». ~ ~
0 ~ ~'¥,.,ovl vfo,oof"iJ .fu
0
0
0
~

6,

°'
0-
~
;>------------------------_J
. -- _.. .. ,

#i nc lu de <s td io .h >
#i nc lu de < st dl ib .h >

st ru ct node
{
in t key;
st ru ct node *t ef t,
*r ig ht ;
};

st ru ct node *newNode
( in t ite m )
{ st ru ct node *temp = (s
tr uc t node *) malloc (s
iz eo f( st ru ct node )) ;
temp->key = m ;
te m p- > le ft =ite
temp->right =NULL ;
re tu rn temp;
}

void in or de r( st ru ct
node *r oo t )
{
if (r oo t != NULL )
{
in or de r( ro ot -> le ft );

p ri n tf ( 11 %d -> ", ro ot
->key);
in or de r( ro ot -> ri g h t)
;
}
}
st ru ct node *i n se rt (s
tr u ct node *node , in
t key)
{

if ( node NULL )
re tur n newNode (key );

if ( key < node ->key)


node -> le ft = in se rt (
node -> le ft , key );
el se
node-> ri g h t = in se rt
( node -> ri g h t, key) ;

re tu rn node ;
}
struct node *minValueNode (struc t node *node)
{
struct node *curre nt = node ;

while (curre nt && curren t->lef t != NULL)


curren t = curren t->lef t;

return curren t;
}

struct node *deleteNode (struc t node *root , int key)


{

if (root= = NULL) , I ,

return root ;

if ( key< root->key)
root-> left = deleteNode (root- >left, key); '
else if (key> root->key) ·
root-> right = deleteNode (root- >righ t, key);

else
{

if (root- >left == NULL)


{
struct node *temp = root-> right;
free (root) ;
return temp;
}
else if (root- >right~ L)

{ struct node ~ p = roo;-> left;


free (root );
return temp;
}

struct node *temp = minValueNode (root- >righ t);

root->key = temp->key;

root-> rig~t = de~eteNode (root- >righ t ; temp->key);


}
C, --
~ - - - - - - - -- - - !
return root ;
}

int main ()
{
struct node *root = NULL ;
int val;
printf( "Enter the elements to be entered in SST : \ n");
while ( 1)
{
scanf( "%d " , &val);
root = insert (root, val);
if (val == 0)
{
deleteNode (root, 0);
printf( "Inorder Traversal:" );
inorder(root);
printf ( "\n Enter the value to be deleted? \t ");
scanf( 11 %d 11 1 &val);
root = deleteNode (root, val);
printf( "Inorder Traversal after elet on: \n ");
inorder(root);
break ;
}
}

PROBLEMS OVPUT TERM INAL DEBUG CONSOLE


I}] Code + '" 8 ~ ( X

PS C:\Users\Adith\Dropbox\Sem 3\DS-C\Code-playground> cd "c:\Use


rs\Adith\ Dropbox\Sem 3\DS- C\Code-playground\'' ; if ( $? ) { gee bs
t . c -o bst} ; i f ($? ) { . \bst }
Enter the elements to be entered in BST:
12
10
11
65
985
8
Inorde; iT, aversal:10 - > 11 -> 12 -> 65 - > 985 ->
Enter th value to be deleted? 985
Inodir Traversal after deletion:
18 ->\q l -> 12 -> 65 - >
~ cfml) \~~
0
W,U\Q. a. C. ~•{X3'10n\ AYJ... 1":ut. 'O.t'\cl

~l°a.VtU ,o. ~-

'0 wj\,A'\ a... °'- ~ -{)'YO <JY·O.("(\ ~ l'm'j>\Q.M ~ AVl---

• \.)\LL °"d.. d,."t'Q VC2.A,U '3.. .


J..

t"i.t~ \:. 4-t"o.l:t


4-t:Q,p !I- ~ 1-~o.-tf:1..t. ..:t:li\.L g t = ~ -"'-l, .f>. ~ ,
~lU ~ cl~o.J W~ , ~ a.Y'd- ~~
c_..,.-ecu_~ CL ~c.-tftm-- \oY' ~ClN~ J

~Q..o t~, w~Q..o~, ~oJtan u...J


cf~~~ C).X\cl ~No & .
o
~~~, ~ ~
C O
• '" ~"'- J.t\~~
~ ~
e.m ~ ~
D
""'~ .).C\ oJ\ /)..." \- ,~ .

.o..t1cl. '1,Q\c,J.e_ Clppro ~';'<d ~ .A.AN\,\"\')


bc®J)C!.R.. ~:J\ ~ 'ooieu1o.J. .
AX~~ "- / · ~.,:'M .ffi:2. p7\l- Oc~~ ~~ O.I.>

'1'"°-N ~ ~~c>,w,f°\W- .
M~ b «i)ehlll- ~ ~ch .t~ ~ v.:>o..v$ w~
~~ A__Ai'~ ~ ~
#include <stdio.h>
#include <s tdl ib. h>

str uc t Node
{
int key;
str uc t Node *le ft;
str uc t Node *ri gh t;
int hei gh t;
} j

int max (in t a , int b);

int height( str uc t Node *N)


{
if ( N == NULL)
ret urn 0 ;
ret urn N->height; .
}

int max (in t a , int b)


{
ret urn (a > b) ? -a : b ;
}

str uc t Node *ne wNode ( int key)


{
str uc t Node *node = (st ru ct Nod
e *) •
malloc( siz eo f (st ru ct Node)) ;
node->key = key ;
node->left = NULL ;
node->right = NULL ;
node->height = l ;
ret urn (node) ;
}

str uc t Node *ri gh tR ota te (st ru ct


Node *Y)
{
str uc t Node *X = y->l ef t;
str uc t Node *T2 = x->ri ght;
x- >r ig ht = y ;
y- >l ef t = T2;

y- >h ei gh t = max ( he ig
ht ( y- >l ef t) , he ig ht (
x- >h ei gh t = max ( he ig y- >r ig ht )) + 1 ;
ht (x -> le ft ), he ig ht (x
-> rig ht )) + 1;
re tu rn x;
}

st ru ct Node *l ef tR ot
at e ( st ru ct Node *X)
{
st ru ct Node *Y = x- >r
ig ht ;
st ru ct Node *T2 = y-
>l ef t;

y- >l ef t = x;
x- >r ig ht = T2;

x- >h ei gh t = max ( he ig
ht ( x- >l ef t) , he ig ht (x->
y- >h ei gh t = max( he ig ri gh t) ) + l ;
ht (y -> le ft ), he ig ht (y ->
ri gh t) ) + l ;
re tu rn y;

getBalance (s tr uc t Node
*N)
{
if ( N == NULL )
re tu rn 0 ;
re tu rn he ig ht ( N-> le ft
) - he ig ht ( N-> ri gh t) ;
}

st ru ct Node *i ns er tN od
e ( st ru ct Node *node ,
in t key )
{

if ( node == NULL )
re tu rn ( newNo e( key ))
;

if ( key < node ->key)


node -> le ft = in se rtN od
e ( node -> le ft , key) ;
el se if ( key > node ->
ke y)
node -> ri gh t = in se rtN
od e ( node -> ri gh t, key)
;
el se
re tu rn node ;
&l&f&!l ~
r---___:::___:::~ ~- - - 7~
node->height = 1 + max ( height ( node->left), _ "'lt
height ( node->right)); ~~
int balance = getBalance ( node ); _
if (balance > 1 && key < node->left->key)
return rightRotate ( node); 3
if (balance < - 1 && key > node->right->key)
return leftRotate ( node );
:Ii
if (balance > 1 && key > node->left->key)
Si~
- IL_
{ ~
node->left = leftRotate ( node->left);
return rightRotate ( node );
}

if (balance < -1 && key < node->right->key)


{
node->right = rightRotate ( node->right);
return leftRotate ( node );
}

return node ;
}

struct Node *minValueNode ( struct Node *node )


{
struct Node *Current = node ;

while (current->left != NULL)


current = current->left;

return current;
}

str uct Node *deleteNode ( struct Node *root , int Key )


{
/
if ( root == NULL )
return root ;

~
if ( key < root->key)
root->left = deleteNode (root->left, key ); ~
f;

'-------- - - -- - - - - - - -- ---------__J ~
else if (key> root->key)
root->right = deleteNode (root->right, key);-

else
{
if ((root->left == NULL) I I (root->right == NULL))
{
struct Node *temp = root->left ? root->left : root->right j

if (temp == NULL)
{
temp = root j
root = NULL ;
}
else
*root = *temp;
free (temp)j
}
else
{
struct Node *temp = minValueNode(r oot->right);

root->key = temp->keyj

root->right = deleteNode (root->right, temp->key)j ·


}
}

if (root == NULL)
return root j

root->height = 1 + max (height (root->left),


~ right));

int balance = getBalance (root );


if (balance > 1 && getBalance(root->\eft) >= 0)
return rightRotate (root);

if (balance > 1 && getBalance (root->left) < 0)


{
root->left = leftRotate (root->left);
return rightRotate (root);
}
(ro ot- >ri gh t) <= 0)
if (balance < - 1 && getBalance
ret urn lef tR ota te (ro ot );

if (balance < -1 && getBalance (ro ot- >ri gh t) > 0)

{
>ri gh t);
roo t-> rig ht = rig htR ota te (ro ot-

}
ret urn lef tR ota te (ro ot ); ry,
~In
ret urn roo t ; ~
}
.J:
void pri ntP reO rde r( str uc t Nod
e *ro ot ) _ !l
{
~Ill
if (ro ot != NULL)
{
pri ntf ( %d , roo t->l<ey); .
11 11
9~
pri ntP reO rde r(r oo t-> lef t);
pri ntP reO rde r(r oo t-> rig ht) ;
~ '
} ~ Jt

}
~I
~ I
int main ()
{
Cc ~
str uc t Node *ro ot = NULL ;
int n =0; C ,
pri ntf ( "E nte r the elements in
AVL tre e: \ n") ; ; ;

whil e (n != - 1)
{
sca nf( 11 %d 11 , &n);
roo t = ins ert No de (ro ot, n);
if (n == 0)
{
pri ntP reO rde r(r oo t);
n = - 1;
an element? \n l.y es \n .no \n ");
pri ntf (11 Do11 you want to de let e
11

sca nf( %d , &n);


if (n == 1)
{

want to de let e? \t ");


pr int f( "\n What element do you
int de l = sca nf ( %d , &de l);
11 11

roo t = deleteNode (ro ot, de l);


__ _ _ __ _ _ _ _ _ __ J ,C
_________
on: \n ") ;
pr in tf (" After de le ti
printPreOrder (r oo t) ;
}

break ;
}
}

re tu rn 0;
}

0V T PU 1:
TER MINAL DEBUG CONSOLE ill Code + v 8 lfilJ < X

PROB LEMS OUTPUT

ro pb ox \S em 3\ 0S -C \Code-playground> cd
PS C:\Users\Adith\D ode-playground \
11

ox \S em 3\D S- C \C
"e : \Users\Adith\Dropb l2 } ; if ($? ) { .\ av
l2 }
e av l2 .e -o av
if ( $? ) { ge
in AVL tr ee :
E nt er th e elements
1
2
3
I
4

I 0
2 1 0 3 4
te an element?
Do you want to de le
1. ye s
2.no
1
1
want to de le te ?
What element do you
A ft er de le ti on :
2034 /

V
CONCJ..USION : J 'm p \~ AV).,
-r~ ::tt-u,

ru\cl . ."b
.
e « .e .~ -
flF AtM.:

~ - "To ..w>u'\Q. °'- C -VYO'j-Tax,c


~d t,\ ~ ..:t"J"O..V <Z.MoJ:J .

-
~U:n.Ot\T\-\M,
.

. ~ ; ·. \ N.'\foJ12.L 0--- s \.'Y\..,\ ~


~ ~,:>..u. ~o~
,0

~
4-t~ ~ ~ ,vttfo-.~~ 0- ~~ ~rttOY'\ ()A~

~(2.Nok , , ~ tJoo9..R , .spu'\-~o& J itl \I o&...u..R. >

o...ncA ~ ~~ .
.c,
~
,0

a..
~
tX'f'lo..AY\ ~~~J ~ \C'I{)~
l.lX~f> : \n
C
~ -\"'I «..Jl •
vo.>.f~ ~ ..,l'(\ OX\
~~~

A-t~ b ·. -(;ro..NfV\.U. .:tM..l. 8 --\:Y~ .


ku...
4-o..- 1"W-- vc&.u.e
0
,n~~ ti) M-0-,\~ -
~":t : ~
0

.Ul2..(J i ·. c.a.,l1
~ t,I,. ~ct,E)(I .

Me..p ~ ·. ~o .
, - - - - - - - - - - - -- - - - -- - - - -- -
c
G,,-

#include <stdio. h>


#include <stdl ib. h>

#define MAX 3
#define MIN 2

struc t BTreeNode
{
int val[MAX + 1], count;
struc t BTreeNode *link [MAX + 1];
};

struc t BTreeNode *root;

struc t BTreeNode *CreateNode ( int val , struc t BTreeNode *child )


{
struc t BTreeNode *newNode;
newNode = ( struc t BTreeNode *) malloc (sizeo f (struc t BTreeNode));
newNode->val[l ] · = val ;
newNode->count = 1;
newNode->link[0] = root;
newNode->link[ l ] = chi l d;
return newNode;
}

void insert Node ( int val , int pos , struc t BTreeNode *node ,
struc t BTreeNode *Child )
{
int j = node-> count ;
while (j > pos )
{
node-> val[j + l ] = node-> val[j ];
node-> link[ j + l ] = node-> link[ j];
j -- ;
}
node-> val[j + l ] = val ;
node-> link[ j + l ] = child ;
node-> count ++ ;
}

void splitN ode ( int val , int *pval , int pos , struc t BTreeNode
*node ,
struc t BTreeNode *Child , struc t BTreeNode **n ewNode )
{

int median I 3• I•

if (pos > MIN)


median = MIN + 1;
else
median = MIN ;

*newNode = (struc t BTreeNode *) malloc (sizeo f(stru ct BTreeNode));


j = median + 1;
while (j <= MAX)
{
(*newNode)-> val[j - median] = node-> val[j] ;
(*newNode)-> link[j - median] = node-> link[j ];
j ++ ;
}
node->count = median;
(*newNode)->count = MAX - median;

if (pos <= MIN)


{
insertNode (val , pos , node , child) ;
}
else
{
insertNode( val , pos - median, *newNode , child) ;
}
*pval = node-> val[node->co unt];
(*newNode)-> link[0] = node-> link[node->c ount];
node->count- -;
}

int setValue (int val , int *pval


struct BTreeNo *node , struct BTreeNode **chi ld)
{
i nt pos;
if ( !node)
{
*pval = val ;
*child = NULL ;
return 1;
}

i f ( val< node-> val[ l ])


__ _ _ _ _ _ __ j
~ - -- - - -_ ___________

You might also like