[algogeeks] Re: whats a "CALL BACK" in C?

2012-05-28 Thread Gene
A callback is a function, say B, that you provide to some other function F in order to control F's behavior. The intuition is that F is defined with a "hole" in its specification that it fills up by "calling back" to the B you furnished. A simple example of a callback is the comparison function a

Re: [algogeeks] whats a "CALL BACK" in C?

2012-05-28 Thread Hassan Monfared
You can pass a function pointer to a function to be called after that function finished its job. On Tue, May 29, 2012 at 12:52 AM, rahul r. srivastava < rahul.ranjan...@gmail.com> wrote: > whats a "CALL BACK" in C? > > -- > You received this message because you are subscribed to the Google Groups

[algogeeks] whats a "CALL BACK" in C?

2012-05-28 Thread rahul r. srivastava
whats a "CALL BACK" in C? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/0jFqwyh8ouwJ. To post to this group, send email to algogeeks@googlegroups.com. To

[algogeeks] Re: Amazon Q : Design a logWritter for server kind of application

2012-05-28 Thread Gene
This is a pretty nice question because it requires you to show knowledge in many different areas. In business settings, logs can make the difference between success and failure, not to mention complying with law. Here are some dimensions of the design space: * Convenience of the programmer's int

Re: [algogeeks] classic problem to tree to circular doubly linked list

2012-05-28 Thread Ashish Goel
//can be improved by having a function to join 2 DLLs struct node *tree2DLL(struct node * pRoot) { if (!pRoot) return NULL; struct node *pleftDLL = tree2DLL(pRoot->left); struct node *pRightDLL = tree2DLL(pRoot->right); //now join left with root pLeftDLL->left->right = pRoot; pRoot->left

[algogeeks] Re: Cpp problem

2012-05-28 Thread Soumya Prasad Ukil
complex_number const & operator =(complex_number & temp) const Since, you are returning *this as reference, you have to have const & as your return type. You have made your this pointer as constant by appending const keyword at the end of the function signature. But this function has limitation si

[algogeeks] Re: classic problem to tree to circular doubly linked list

2012-05-28 Thread Gene
The recursion invariant is that calling convert(root, list) will return a list that is the tree root converted to a singly linked list connected by 'left' pointers, with list appended at the end. So if the tree is empty, the corresonding list is empty, so appending argument 'list' on the end me