Datastructure Interview Questions and answers
Hi, please post the possible data structure interview Questions and answers.. it will be helpfull for all who reffers this post. Thanks ...
Hi, please post the possible data structure interview Questions and answers.. it will be helpfull for all who reffers this post. Thanks ...
Not sure how to phrase this but I'm wondering if I can create a catchall error handler that umbrellas the entirety of the code, to send to a custom handler that outputs the info graphically within the program. Something along the lines of: root.addEventListener(ErrorEvent.ERROR, this.customHandler); I'm hoping to stop any and all fr...
Hello F# folks, Suppose we have a Matrix class in F# and you overload the (+) operator. Then, we will have something like this: type Matrix(n : int, m : int) = ... static member (+) (A : Matrix, B : Matrix) = let res = new Matrix(A.Dim1, A.Dim2) // suppose A and B have the same dimension ... // compute here th...
I am writing an android game that involves some c++. I have a fairly repeatable crash that seems to be due to my c++ code Looking at the page: http://source.android.com/porting/debugging_native.html#Debug_Scenarios (right at the end) it says to run the output through the "stack tool" - which I can find no trace of.. nor aproto - any he...
I asked this question to get to know how to increase the runtime call stack size in the JVM. I've got an answer to this, and I've also got many useful answers and comments relevant to how Java handles the situation where a large runtime stack is needed. I've extended my question with the summary of the responses. Originally I wanted to ...
Hello all. I'm having a MIPS issue here. What I'm trying to do is have the user input any number and have the program spell out the name of each digit in the number. So for example, the user inputs 495 and the machine would spell out "Four Nine Five". I'm trying to push each digit of the number onto the stack, then pop each one off. ...
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCellFixed *cell = (UITableViewCellFixed *)[tableView cellForRowAtIndexPath:indexPath]; the second line (ie: the first line after the function is declared) is repeating itself indefinitely. I have no idea why. I got a stack ov...
You can see the full problem here: http://users.cjb.net/syn4k/test.htm I have described the problem in full at this location. Edit: since you have asked to see the problem here as well, Drag and drop the outlined items from one column to another and then try sorting the items in that column Issue: The items do not stack after sort but r...
Hi all, so I'm having a crazy time right now reading characters off a stack. I'm storing the char as an int, so I can check for the EOF signal, but things aren't going so well. I'm new to the implementation of stacks, so things are probably just wrong somewhere. Here's my code. I'm getting both the incorrect top character on the stack (...
I need to instansiate an object and add it to an array. This is what I currently have in a method: Row r; rows[count] = r; The problem here is r is on the stack and being removed after the function exits. I quick fix is to make r static but that is bad right? What should I do? (Sorry, complete C++ noob). Edit: Removing the deconstruc...
I have this structure: class Base { public: void doACopy(char* strToCopy) { strcpy(str, strToCopy); } private: char str[4]; }; class Derived : public Base { public: void doSomething() { char toCopy[4]; toCopy[0] = 'a'; toCopy[1] = 'b'; toCopy[2] = 'c'; Base::doACopy(toCopy); // is there a...
Possible Duplicate: Why are structs stored on the stack while classes get stored on the heap(.NET)? Can anyone tell me that how the allocation of memory is done that which object is to be stored in stack and which to be in heap portion of the memory? ...
When you create a new object in C++ that lives on the stack, (the way I've mostly seen it) you do this: CDPlayer player; When you create an object on the heap you call new: CDPlayer* player = new CDPlayer(); But when you do this: CDPlayer player=CDPlayer(); it creates a stack based object, but whats the difference between that a...
In building an iPhone app, I created a secondary thread to handle real-time tasks. Apple Developer documentation seems to indicates a "recommended/maximum" stack size of 512KB (524288 bytes) for secondary threads. http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html ...
The following code doesn't work as intended but hopefully illustrates my attempt: long foo (int a, int b) { return a + b; } void call_foo_from_stack (void) { /* reserve space on the stack to store foo's code */ char code[sizeof(*foo)]; /* have a pointer to the beginning of the code */ long (*fooptr)(int, int) = (long (*)(int...
hi all, it's first time for me I use java I need to use a stack in android funcions but if I define the stack out of the function give me the error (should be parametrized) and the application crashes public class Televideo extends Activity{ Stack pila = new Stack(); @Override public void onCreate(Bundle savedInstanceState)...
Which is preferred, method 1 or method 2? Method 1: LRESULT CALLBACK wpMainWindow(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) { case WM_PAINT: { HDC hdc; PAINTSTRUCT ps; RECT rc; GetClientRect(hwnd, &rc); hdc = BeginPa...
Forgive me If this is a dumb question. Can one programmatically "observe" the contents of stack and heap while an application (say a console app) is running? Are there any APIs which would do this? ...
When writing in C, how can I tell how much stack space is available in memory when I launch a program? How about heap space? How can I tell how much memory is being used during the execution of my program? ...
stack <char> stck; string str; stck.push('0'); str.append("test:"); //test: cout << str << endl; str.append(&stck.top()); //test:0═══════════════¤¤¤¤▌▌▌▌,╘╥XЕ┤ cout << str << endl; Why is this happening? ...