Asked Questions and Answers: 1.)Your Introduction? 2.) Your objective? 3.) Tell me something about your family?

(This is their favorite question so pre pare it well) 4.) Why HCL? 5.) If you are already placed in another company, then why HCL over that company ? 6.) What do u know about HCL?.(www.hcltech.com and PPT) The HCL Enterprise is one of India's largest electronics, computing and information technology company. Based in Noida, near Delhi, the company compris es two publicly listed Indian companies, HCL Technologies and HCL Infosystems. HCL was founded in 1976 by Shiv Nadar, Arjun Malhotra, Subhash Arora, Ajai Chowd hry, DS Puri, & Yogesh Vaidya. HCL was focused on addressing the IT hardware mar ket in India for the first two decades of its existence with some sporadic activ ity in the global market. On termination of ich comprises HCL L Infosystems (to then operated as the joint venture with HP in 1996, HCL became an enterprise wh Technologies (to address the global IT services market) and HC address the Indian and APAC IT hardware market). HCL has since a holding company.

1976 - HCL (Hindustan Computers Limited) is created. 1977 - Forms distribution alliance with Toshiba for copiers and notebooks 1978 - Developed the first indigenous Microcomputer 1988 - Development of fine-grained multiprocessor Unix operating system 1986 - HCL becomes the largest IT company in India 1989 - HCL America is created with Sanmina SCI as its manufacturing partner. 1991 - Entered into a partnership with HP to form HCL HP Limited. Developed a cu stom Multiprocessor Unix for HP 1994 - Tied up with Nokia for mobile phone distribution and Ericsson for telepho ne switch distribution.[3] 1996 - Partnership with HP ends. 1997 - HCL's R&D division is spun off as HCL Technologies [4] 2001 - HCL BPO is created. 7.) Incidents in support of all that u have mentioned in C.V? (V.imp) 8.) How are you different than other candidates? Why should we recruit you? 9.) What s unique about you? 10.)Any plans for higher studies? (Big No!!!!) 11.) Any Problem in Relocation? (Strict no no.). 12.)Your Hobbies, Interests, Strengths and Weaknesses, some other ques from C.V. 13.) One thing that irritates you the most and why? 14.) You may need to explain your projects also. 15.) Do you want to ask something from me? Don't forget to ask a question because it shows that you are interested in this job. You may ask anything about company and job you are applying for. 16.Encapsulation? Encapsulation is also known as information hiding, it is to protect data from the client using the classes but still allowing the client to access the d ata, but not modify it. Through a public interface, the private data can be used by the client class without the worry of the user messing with the private data . An example of encapsulation is declaring an instance variable private, and hav ing an accessor method that allow access to the variable. 17.Which sort show the best average behavior? quick sort

18.What is a datastructure? A data structure is a specialized format for organizing and storing data . General data structure types include the array, the file, the record, the table, the tree, and so on. Any data structure is designed to organize data to suit a specific purpose so that it can be accessed and worked with in appropriate ways. 19. How would you sort a linked list? using merge sort. 20.What is atmost complete binary tree? An almost complete binary tree is a tree in which each node that has a r ight child also has a left child. Having a left child does not require a node to have a right child. Stated lterna tely, an almost complete binary tree is a tree where for a right child, there is always a left child, but for a left child there may not be a right child. The number of nodes in a binary tree can be found using this formula: n = 2^h Wh ere n is the amount of nodes in the tree, and h is the height of the tree. 21.what is hashing? Hashing is a way retrieving records from memory in faster way.Record is inserted into memory by using hash function (division,midsqure,folding,digit analysis)and also records are retrieved using s ame hash function. 22. What are the parts of root node? A root node contains data part and has link part. i.e links to its child . if it is binary tree it has two links i.e left child and right child. 23.What does abstract data type means? If for a particular collection of data only the structure of data and th e functions to be performed on the data is defined but the implementation is not defined,then such a collection of data is called Abstrct data type. 24.What is B+ tree? A B+ tree is a data structure in which records associated with the searc h keys are at the leaves of the tree. This provide efficient retrieval,insertion and removal of records.Keys are tripl icale to the non-leaf nodes to provide a path to the searched record.NT file system,JFS2 file system and Rationaldata bas e often used this data structure for indices. 25.Convert the following infix expression to post fix notation ((a+2)*(b+4)) -1 a2+b4+*1( ( a + 2 ) * ( b + 4 ) ) - 1 \ / / a2+ b4+ / \ / / / a2+b4+* / \ / a2+b4+*1-

26.What do you mean by Base case, Recursive case, Binding Time, Run-Time Stack a

else // recursive case: return num*Fact(num-1). int target. if(end>start){ mid=(start+end)/2.ele).ele).Base Case:it is the case in recursion where the answer is known.A tail Recursion can be replace by iteration.h> int binarysearch(int list[]. All Stack Operations are done using Head Pointer. int end. For example to find Factorial of num using recursion: int Fact(int num){ if(num==1 num==0)//base case return 1. while(first<=last) { .Write a Binary Search program? #include<conio.int el){ int mid.nd Tail Recursion? These terms are found in Recursion. Tail Recursion:The case where the function consist of single recursive call and it is the last statement to be executed.end. The above funtion consists of tail recursion case.h> #include<process. last=end. void binary(int start.local variables and return value if any.mid-11. else binary(start. Explain? Because stack will contain a head pointer which will always point to the top of the Stack.Stack can be described as a pointer.int end. 1. else{ if(el>ar[mid]) binary(mid+1. mid. Run Time Stack:It is a system stack us to save the frame stack of a function every recursion or every call. where as the below function does not. int &locn) { int first=0. } 2.or we can say the termination condition for a recursion to unwind back. Hence Stack ca be Described as a Pointer 28.Recursive case:It is the case whcih brings us to the closer answer. if(el==ar[mid]) return mid.h> #include<iostream. This frame stack consists of the return address. } } } 27.

else cout<<"\nThe element "<<s<< " is not found in the List"<<endl. Logical Error. for(i=0. cout<<"\n Enter the no.Ram is a boy.n.-error correct. if(binarysearch(a. return(target==list[mid]). program will execute properly but not gi ve answer correct. } void main() { int a[10].i++) cout<<a[i]<<"\t".mid=(first+last)/2.loc.How will inorder.flag=0. out of memory capacity.&loc)) cout<<"\nThe element "<<s<< " is available at location "<<loc<<endl. preorder and postorder traversals print the elements of a t ree? .s. cin>>s.Here is correct. } 29. clrscr().s=0.Table is a boy syntax correct but meaning is not Runtime Error. EX. if(target>list[mid]) first=mid+1. Runtime Error? Syntax Error-Errors in coding which do not follw language syntax format.n. else break.overflow. cout<<"Enter the Elements:\n".Which data structure is needed to convert infix notations to post fix notatio ns? Stack 31. It can occur by human mistak in typing & due lack knowledge of language . of element to store:\n".i<n.i++) cin>>a[i]. underflow.i<n. for(i=0.Ram are a boy. EX . } locn=mid+1. cout<<"\n Enter the Element to search:\n". cin>>n. 30. else if(target<list[mid]) last=mid-1.What do you mean by: Syntax Error. cout<<"\n The Elements are:\n".i. Logical Error.

.tree->data). Why? Basically Parenthesis indicate the operations which need to be carried o ut first ie according to the BODMAS rule.tree->data). . Where the brackets have already been taken into consideration. } void postorder(node * tree) { if(tree != NULL) { postorder(tree->leftchild). inorder(tree->rightchild). } else return.. } else return. postorder(tree->rightchild).tree->data). } void preorder(node * tree) { if(tree != NULL) { printf("%d ". } else return. and a right binary tree. OR A binary tree either * is empty (no nodes). 33.and the formed p refix/postfix expression is the correct order of expansion of a given mathematical statement. printf("%d ". preorder(tree->leftchild).Parenthesis are never needed in prefix or postfix expressions. 34... SO in case of postfix or prefix expression they are actualy conversions of the o rginal standard equation. a left binary tree.void inorder(node * tree) { if(tree != NULL) { inorder(tree->leftchild). } 32.what is the need of data structure? if we can learn about large amount of information the concept of data st ructure is used. or * has a root node.what is binary tree? A tree with at most two children for each node. printf("%d ". preorder(tree->rightchild).

Which sort w ould take the shortest time to execute? Bubble Sort Or Insertion Sort 38..If they are sorted in ascending/descending order the tree will definitely become unbanlanced Fibnacci search The Fibonacci Sequence is defined such that the first two numbers of the sequenc e are 0 and 1.which is bi-directional that has both head and tail part .Explain about the types of linked lists? Singly linked list.. display data 2. Doubly linked list.g. 37. recursive traverse left su btrees entirely 2..b + c * (d / e . 1.. recursive traverse right subtrees entirely o pre-order: 0 if param node is null return 1.35. recursive traverse right subtree entirely 3. 1.. o For example. 2. 1. 40.A list is ordered from smaller to largest when a sort is called. o post-order: 0 if param node is null then return.. 8.Explain binary searching.How is it possible to insert different type of elements in stack? you ca implement stack with union datatype... Best way is to ensure the inputted data is coming in with random values.Convert following infix expression to the prefix expression a .. recursive travers e left subtrees entirely 3.. e. recursive traverse left subtrees entirely 2.0. but in union only one at a time. 1.....Which one is faster? A binary search of an orderd set of elements in an array or a sequential search of the elements? binary search if of order log n where as sequential search is of order n. 13 . Fibinocci search? Searching a binary tree for a value that matches a key value is FAST. u may think of structures. 39. but struct use storin of all values and mem allocated for all in each.. es pecially for tightly packed trees (a tightly packed tree contains about twice as many elements as the previous level) o Therefore at most log(2)n comparisons are required either to find a match or d etermine that no match exists. if parameter node is null then return. 5.(f + g)) +-ab*c-/de+fg a-b+c*(d/e-(f+g)) a-b+c*(d/e-(+fg)) a-b+c*(/de-(+fg)) a-b+c*(-/de+fg) a-b+(*c-/de+fg) -ab+(*c-/de+fg) +-ab*c-/de+fg (final answer) 36. binary search is faster. display data o to keep it efficient you must make sure to keep tree balanced. display data 3. this is right i think. searching a tightly packed 1000-element binary search tree requie s at most 10 comparisons because 2 o a binary search tree with n elements has a minimum of log(2)n levels o in-order: 0. . 3. recursive traverse right subtree entirely. subesequent numbers are the sum of the previous two.which is linear direction that has only head part.

clrscr().i++) printf("%d\t".temp.a[i]). clrscr(). void main() { int arr[20]. } /*QUICK SORT*/ #include<stdio. getch(). a[j+1]=temp. printf("\nQUICk SORT\n"). printf("the sorted list is :->\n").h> #include<conio. printf("Enter the elements:").Circular linked list.i++) scanf("%d". printf("enter the elements ").i<n. printf("Enter the no. for(i=0.h> #define SIZE 5 void main() { int a[SIZE]. a[j]=a[j+1].n).&n). } void quicksort(int a[].of elements:").i<SIZE. getch().0.int lower. } for(i=0.i. Quick sort? //PROGRAM FOR BUBBLE SORT #include<stdio.i++) printf("%d".int upper) .n. void quicksort(int [].int.i.i++) printf("%d\t".j++) if(a[j]>a[j+1]) { temp=a[j]. quicksort(arr. for(i=0.h> int split(int []. 41. scanf("%d".j. printf("\nArray after sorting:\n").int).i++) scanf("%d".which as no ends.arr[i]).i++) for(j=i.i<n.i<SIZE.n.&arr[i]). for(i=0. printf("\nArray before sorting:\n").Write programs for Bubble Sort.int. for(i=0.i<n.j<SIZE-i.&a[i]).int).arr[i]). for(i=0.i<SIZE.h> #include<conio.

. node *head=NULL. return(q). } } t=a[lower].i+1.int lower. } 42. if(upper>lower) { i=split(a. void addfirst(). }.lower.int upper) { int i.h> struct link { int item. void addmid(). a[lower]=a[q].q.h> #include<conio. a[q]=t. void display().p.upper). quicksort(a. q=upper. void main() { int ch. while(q>=p) { while(a[p]<i) p++. struct link *next.Write the programs for Linked List (Insertion and Deletion) operations? /*OPERATIONS ON SINGLY LINKED LIST*/ #include<stdio. a[q]=t. a[p]=a[q]. void dellast(). void addlast(). if(q>p) { t=a[p].upper). } } int split(int a[]. void delmid(). void delfirst(). while(a[q]>i) q--. quicksort(a.t.i-1). i=a[lower]. p=lower+1.{ int i.lower. typedef struct link node.

case 6: dellast(). display(). display().DeleteLast\n7. getch(). display(). temp=(node *)malloc(sizeof(node)). display().clrscr(). case 7: display().DeleteMiddle \n6. break.&temp->item). head=temp. case 2: addmid(). scanf("%d". break. display().Display\n8.AddMid\n3.. break. break. case 4: delfirst()... break. printf("\n1.Exit\n"). default: printf("Invalid Choice\n"). } void addfirst() { node *temp.\t"). printf("Enter your option:\t"). case 3: addlast(). case 8: exit(0). switch(ch) { case 1: addfirst(). display(). break.Addfirst\n2. } } while(ch<=8). break. scanf("%d". temp->next=head. do { printf("\nSINGLY LINKED LIST OPERATIONS\n").&ch). } . break. case 5: delmid(). printf("Enter the data.DeleteFirst\n5.AddLast\n4.

scanf("%d". head=head->next.. printf("\nEnter the position\t"). cur->next=temp. printf("Deleted item is %d\n". } temp->next=cur->next. } if(pos==i+1) { temp=(node *)malloc(sizeof(node)). temp=(node *)malloc(sizeof(node)). } void delmid() { int i=1. cur->next=temp.&temp->item). while(cur->next!=NULL) { cur=cur->next."). node *cur=head.pos.void addmid() { int i=1.&temp->item).. printf("Enter the data. scanf("%d". free(temp).").*cur=head. } void delfirst() { node *temp=head. scanf("%d".&pos).*temp. } if(pos==i+1) { . while(pos!=i+1&&cur!=NULL) { cur=cur->next. printf("\nEnter the data. temp->next=cur->next.&pos). i++. i++. printf("Enter the position to be deleted\t"). node *cur=head... while(pos!=i+1&&cur->next!=NULL) { cur=cur->next.*temp. scanf("%d".temp->item).pos.. } } void addlast() { node *temp.

temp=cur->next. int a[30][10]. } 43. cur->next=temp->next.Insertion Sort? Insertion sort is a simple sorting algorithm.2D array? An ordered arrangement of data elements. a comparison sort in which the sorted array (or list) is built one . but not in the middle? Double ended queue 44. Multi-dimensional arrays are used extensively in scientific simulation and mathe matical processing.cur->item). A vector is a one dimensional a rray.Array? An array is a systematic arrangement of objects. char ticTacToeBoard[3][3]. free(temp). while(cur->next->next!=NULL) { cur=cur->next. however. } temp=cur->next.*cur=head. an array can be as simple as a pricing table held in memory for instant access by an order entry program. Most programming languages have the ability to store and manipulate arrays in on e or more dimensions. cur=cur->next.temp->item).temp->item). printf("Deleted item is %d\n". // three rows and three columns of chars. while(cur!=NULL) { printf("\t%d". printf("Deleted item is %d\n". printf("\nHead->"). In which data structure. } } void dellast() { node *temp. 45. free(temp). elements can be added or removed at either end. } printf("<-NULL\n"). cur->next=NULL. Two-dimensional arrays are declared by specifying the number of rows the n the number of columns. usually in rows and col umns 46. } void display() { node *cur=head. // declares an int array of 30 rows and 10 columns. a matrix is a two-dimensional array.

Typically. In most implementations it is stable. It is nothing to do with any programming language although a programming language which support the oops concept to make it easier to implement. 47. insertion sort provides several advantages:Adaptive. It is much less efficient on large lists than more advanced alg orithms such as quicksort.c is not objec t oriented but c++ is object oriented. quicksort is significantly faster in practice than other \mathcal{O}( n \log n) algorithms. This is the main different between c and c++. In the worst case. It is a concept or approach for designing a new software. it is very well suited to modern computer architectures. . but is not a stable sort. it is possible to make design choices which minimize the probability of requirin g quadratic time. On the other hand c++ is an object oriented programming language which eliminate some pitfall of conventional or procedural programming language. 51. quicksort tends to make excellent usage of the memory hierarchy. 48. c is a topdown approach while c++ is bottom up approach. it has the advantage of a more favorable worst-case T(n log n) runtime. on average. A. though if implemented correctly this beh avior is rare. Complexity. and in most real-world data. It has some drawback like a global data is shared by all function and if in a large program it is fin d out difficult that which function uses which data. Coupled with the fact that quicksort is an in-place sort and uses no temporary memory. Hoare that. R. it makes \mathcal{O}(n^2) comparisons.What is a virtual base class? Virtual base class is a base class acts as an indirect base for more tha n one without duplication of its data members. because its inner loop can be efficiently implemented on most architectures. and is part of the sel ection sort family. However.Stable. t aking perfect advantage of virtual memory and available caches.Quick Sort? Quicksort is a well-known sorting algorithm developed by C. 50.In-place.Heap Sort? Heapsort is a comparison-based sorting algorithm. 49. heapsort. Heapsort is an in-place algorithm.entry at a time. Additionally. what is the main difference between c and c++? Actually c is a procedural programming language which cann't face the re al world problem. or merge sort. meaning that it preserves the input order of equal elements in the sorted output .Merge Sort? Merge sort is an O(n log n) comparison-based sorting algorithm. makes \mathcal{O}(n\log n) (big O notation) comparisons to sort n items. Although somewhat slower in practice on most machines than a good implementation of quicksort.

each member have their own memory space 55.Static Variable? A variable that retains the same data throughout the execution of a prog ram. Built-in resources increase reliabilit y because they do not require any external circuitry to be working for the resou . public C { /* . one block is used by all the member of the union but in case of str ucture. virtual public A { /* .) In the case of pointers to classes.. we can use polymorphism and virt ual classes to change the behavior of pointers to various types of classes at runtime Coming to the disadvantages of pointers 1. For example: A / B \ class class class class A B C D { : : : C / D /* .) Function cannot return more than one value. */ }.. But when the same functi on can modify many pointer variables and function as if it is returning more than one variable. */ }.. // indirect base class virtual public A { /* .) If sufficient memory is not available during runtime for the storage of pointers. union allocates the memory equal to the maximum memory required by the member of the union but structure allocates the memory equal to the total memory required by the members. a dynamic variable can have different values during the course of a program. */ }.A single copy of its data members is shared by all the base classes that use it as a virtual base. the program may crash (very possible) 53.What are the advantages and disadvantages of pointer in C language? The main advantages of using pointers are 1.. In union. 54. public B. 3. we can decide the size of th array at runtime by allocating the necessary space.What are the differences between a union and a structure in C? The difference between structure and union in c are: 1. An on-chip resource is a block of circuitry built into the MCU which performs some useful function under control of the MCU.Advantages of Microcontroller compared to Microprocessor? The advantages of microcontroller are that all MCUs have on-chip resourc es to achieve a higher level of integration and reliability at a lower cost..) If the programmer is not careful and consistent with the use of poin ters.) In the case of arrays. the program may crash (least possible) 2. 52. 2. // valid \ Using the keyword virtual in this example ensures that an object of clas s D inherits only one subobject of class A. In contrast... */ }.. 2.

}node.rce to function. void inorder(node *). and electrically erasable memory (EEM).*root. The term EE M actually refers to an engineering development version of an MCU where EEPROM i s substituted for the ROM to reduce development time. Some of the more popular on-chip resources are memory devices. . Othe r timer functions include timer compare and/or input capture lines. void postorder(node *). Other built-in resources may include computer operating properly (COP) w atchdog system which can be hardware or software based. I/O includes serial communication ports.Binary Tree Program? /*Binary Tree Travesals*/ #include #include #include typedef struct bst { int data.*right. Timers include both real-time clocks and periodic interrupt timers. /*Main Function*/ void main() { int ch. at 6:47 AM 56. liquid cryst al display drivers (LCD). struct bst *left. node *New. They are pre-tested by the manufacturer and conserve board spac e by integrating the circuitry into the MCU. s ystem clock/oscillator. parallel ports (I/O lines). electrically erasabl e programmable ROM (EEPROM). node *). digital-to-analog (D/A) converters. void preorder(node *). timers. node *get_node().ans=5. erasable programmable ROM (EPROM). clrscr(). Memory devices include read/write memory (RAM). void insert(node *. ana log-todigital (A/D) converters. root=NULL. read-only memory (ROM). and I/O. and vacuum fluorescent display drivers (VFD).

else { printf("\n~~~PREORDER TRAVERSALS~~~\nThe Tree is:\n"). case 2: if(root==NULL) printf("\nNo element In Tree\n").while(1) { printf("\nEnter:\n1-Create\n2-Preorder\n3-Inorder\n4-Postorder\n5-Exit\n"). } break. ans=New->data. break. do { New=get_node(). switch(ch) { case 1: printf("\nEnter Elements 1 by 1: (0 to stop entering)\n"). case 3: .New). if(ans!=0) if(root==NULL) root=New. scanf("%d".&New->data). else insert(root.&ch). preorder(root). }while(ans!=0). scanf("%d".

break. exit(0). else { printf("\n~~~POSTORDER TRAVERSALS~~~\nThe Tree is:\n"). . temp=(node *)malloc(sizeof(node)). default: printf("\n~~~Exit~~~\n").if(root==NULL) printf("\nNo element In Tree\n"). inorder(root). } break. case 4: if(root==NULL) printf("\nNo element In Tree\n"). } } } /*Get node*/ node *get_node() { node *temp. getch(). else { printf("\n~~~INORDER TRAVERSALS~~~\nThe Tree is:\n"). } break. postorder(root).

New).node *New) { if(New->data < root->data) { if(root->left==NULL) root->left=New.New). else insert(root->right. else insert(root->left. .temp->left=NULL.temp->data). } if(New->data > root->data) { if(root->right==NULL) root->right=New. return temp. preorder(temp->right). preorder(temp->left). } } /*preorder Traversals*/ void preorder(node *temp) { if(temp!=NULL) { printf("-> %d ". } /*Insert Function*/ void insert(node *root. temp->right=NULL.

} } /*Inorder Traversals*/ void inorder(node *temp) { if(temp!=NULL) { inorder(temp->left). printf("-> %d ". postorder(temp->right). inorder(temp->right). } } OUTPUT: /*Binary Tree Traversals*/ Enter: 1-Create 2-Preorder 3-Inorder 4-Postorder 5-Exit 1 . } } /*postorder Traversals*/ void postorder(node *temp) { if(temp!=NULL) { postorder(temp->left).temp->data).temp->data). printf("-> %d ".

Enter Elements 1 by 1: (0 to stop entering) 5 3 7 2 4 6 9 0 Enter: 1-Create 2-Preorder 3-Inorder 4-Postorder 5-Exit 2 ~~~PREORDER TRAVERSALS~~~ The Tree is: -> 5 -> 3 -> 2 -> 4 -> 7 -> 6 -> 9 Enter: 1-Create 2-Preorder 3-Inorder 4-Postorder 5-Exit 3 ~~~INORDER TRAVERSALS~~~ The Tree is: -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 9 Enter: 1-Create 2-Preorder 3-Inorder 4-Postorder 5-Exit 4 ~~~POSTORDER TRAVERSALS~~~ The Tree is: -> 2 -> 4 -> 3 -> 6 -> 9 -> 7 -> 5 Enter: .

switch(choice) { case 1: puts("Enter integer: To quit enter 0"). struct rec *insert(struct rec *tree.long num).continue. . int choice. }continue. long digit. }}while(choice!=3). struct rec *tree=NULL.&digit).digit). scanf("%ld". while(digit!=0) { tree=insert(tree. scanf("%ld". do{ choice=select(). }. case 3: puts("END"). void *exchange(struct rec *tree).&digit). case 2: printf("%5d\n". struct rec *left.1-Create 2-Preorder 3-Inorder 4-Postorder 5-Exit 5 or #include<stdio.exit(0). struct rec *right.h> #include<conio.exchange(tree). void main() { struct rec *tree=NULL.tree->num). struct rec *temp.h> struct rec {long num.

printf("%5ld\n".digit). tree->left=tree->right=NULL.}int select() {int selection.tree->right->num). else if(digit==tree->num) {puts("Duplicates Nodes: Program Exited"). tree->num=digit. else if(digit>tree->num) tree->right=insert(tree->right. }} . }}while((selection<1) (selection>3)).digit). }else if(digit<tree->num) tree->left=insert(tree->left.tree->left->num). puts("Enter 2: Exchange subtrees"). scanf("%d". puts("Enter 3: End"). }struct rec *insert(struct rec *tree. puts("Enter your choice").long digit) {if(tree==NULL) {tree=(struct rec *)malloc(sizeof(struct rec)).exit(0). }void *exchange(struct rec *tree) {if((tree->left->num!=0)&&(tree->right->num!=0)) {temp=tree->left. tree->left=tree->right. }return(tree). exchange(tree->right). tree->right=temp.&selection). getchar(). if((selection<1) (selection>3)) {puts("Wrong choice: Try again"). return selection. do {puts("Enter 1: Insert a node"). printf("%5ld\n". exchange(tree->left).

Sign up to vote on this title
UsefulNot useful