logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • How would you reverse a doubly-linked list?


  • Correct Answer
  • This problem isn't too hard You just need to start at the head of the list, and iterate to the end At each node, swap the values of pNext and pPrev Finally, set pHead to the last node in the list Node * pCurrent = pHead, *pTemp; while (pCurrent) { pTemp = pCurrent->pNext; pCurrent->pNext = pCurrent->pPrev; pCurrent->pPrev = temp; pHead = pCurrent; pCurrent = temp; } 


  • Technology problems


    Search Results


    • 1. Write an algorithm to separate all ones & zeroes in an array.
    • Discuss
    • 2. Define stored procedure. What are its advantages and disadvantages?
    • Discuss
    • 3. What are the different types of system calls?
    • Discuss
    • 4. What exactly do you mean by UDP?
    • Discuss
    • 5. Explain the basic difference between 32-bit and 64-bit operating system?
    • Discuss
    • 6. Write a method to fill all the spaces in a string with '%20'
    • Discuss
    • 7. Difference between system call and API
    • Discuss
    • 8. What is Marshalling?
    • Discuss
    • 9. How do you handle errors in CICS programs?
    • Discuss
    • 10. How can you have different number of cells for each row of a table?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment