Companies
- Accenture
- Adobe
- Alcatel-Lucent
- Alten Calsoft Lab
- Amazon
- Amdocs
- Aricent
- Arris
- Broadcom Ltd
- Brocade
- CA Technologies
- Capgemini
- Cavium Networks
- CenturyLink
- Ciena
- Cisco
- Citrix
- Cognizant
- Comcast
- CSC (DXC Technology)
- Dell EMC
- Deloitte
- EFI
- Ericsson
- Extreme Network
- Genpact
- Gigamon
- Global Edge
- GlobalLogic
- Goldman Sachs
- Happiest Minds
- HCL Technologies
- Hewlett Packard Enterprise
- IDS Infotech
- Incedo
- Infinite C S
- IpInfusion
- J.P. Morgan
- Juniper Network
- L&T Technology Services
- MindTree
- MosChip Semiconductor
- NEC Technologies
- NIIT Technologies
- OLA
- One Access
- PayPal
- Paytm
- Qualcomm
- Radisys
- Redeem Software
- Reliance Jio
- Rolta India Limited
- Samsung
- Sasken
- Siemens
- Synopsys
- Tavant Technologies
- TCS
- Tech Mahindra
- Viasat
- Wipro
- XiLinx
Interview Questions and Answers :: Data Structure
void GetNthFromLast(struct node* head, int n)
{
int len = n, i;
struct node *temp = *temp1 = head;
while (temp != NULL)
{
if (len > 0)
{
temp = temp->next;
len--;
continue;
}
temp = temp->next;
temp1 = temp1->next;
}
if (len)
{
printf("\r\n Node in the given Linked list is not enough \r\n");
return;
}
printf ("%d\n", temp1->data);
return;
}
No Tags on this question yet!
int *p;
p = (int *) malloc(2 * sizeof (int));
When memory allocation is done, the actual heap space allocated is one word larger than the requested memory. The extra word is used to store the size of the allocation and is later used by free( )
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
1) Sort the array in ascending order.
2) Initialize two index variables to find the 'S'
  elements in the sorted array.
    (a) Initialize first to the leftmost index: l = 0
    (b) Initialize second the rightmost index: r = ar_size-1
3) Loop while l < r.
    (a) If (A[l] A[r] == S) then return 1
    (b) Else if( A[l] A[r] < sum ) then l
    (c) Else r--  Â
4) No 'S' in whole array - return 0
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
There's one input message queue where can we read from, and there is three output message queue that you can write to. The message has alphanumeric key value. There could be duplicate key values coming out of the input queue and once we put a key value say "ABC1234" to output queue-1, whenever we get a key value ABC1234 it should go to queue-1 only. Also, we should try to balance the load among the 3 output queues.
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
No Discussion on this question yet!
No Tags on this question yet!
#include
#include
int main()
{
int row, col,i;
int **arr ;
printf ("Enter Row and Column\n");
scanf("%d %d",&row,&col );
printf("%d %d\n",row,col );
**arr = (int **) malloc (sizeof (int)*row);
for (i = 0; i < row; i++)
{
arr[i] = (int *) malloc(sizeof(int)*col);
}
return 0;
}
No Tags on this question yet!