Showing posts with label C Programming. Show all posts
Showing posts with label C Programming. Show all posts

Thursday, December 18, 2008

Data structures questions

What is heap sort?
How to reverse the odd bits of an integer?
Check if the 20th bit of a 32 bit integer is on or off?
How to reverse the bits in an interger?
What purpose do the bitwise and, or, xor and the shift operators serve?
Write a C program to count bits set in an integer?
What is a threaded binary tree?
Write pseudocode to add a new node to a Binary Search Tree (BST)
Implement Breadth First Search (BFS) and Depth First Search (DFS)
A full N-ary tree has M non-leaf nodes, how many leaf nodes does it have?
How many different trees can be constructed using n nodes?
What is an AVL tree?
How do you convert a tree into an array?
Given an expression tree, evaluate the expression and obtain a paranthesized form of the
Find the closest ancestor of two nodes in a tree.
Construct a tree given its inorder and preorder traversal strings. Similarly construct a tree given

C source code questions

Write your own strcat() function
Write a C program to implement the strlen() function
Write a C program to implement your own strdup() function.
Write C programs to implement the toupper() and the isupper() functions
Write your own copy() function
Implement the substr() function in C.
Implement the strcmp(str1, str2) function.
Implement the strcpy() function.
Write your own printf() function in C
Write C code to implement the strstr() (search for a substring) function.
Implement the memmove() function. What is the difference between the memmove() and memcpy () function?
Write your own C program to implement the atoi() function
How can I search for data in a linked list?
How to read a singly linked list backwards?
Write a C program to remove duplicates from a sorted linked list
Write a C program to insert nodes into a linked list in a sorted fashion
How would you find out if one of the pointers in a linked list is corrupted or not?
Write a C program to return the nth node from the end of a linked list.
Can we do a Binary search on a linked list?
Write a C program to free the nodes of a linked list
How to create a copy of a linked list? Write a C program to create a copy of a linked list.
How to compare two linked lists? Write a C program to compare two linked lists.
If you are using C language to implement the heterogeneous linked list, what pointer type will you use?
How do you find the middle of a linked list? Write a C program to return the middle of a linked list
How would you detect a loop in a linked list? Write a C program to detect a loop in a linked list.
How do you reverse a linked list without using any C pointers?
Write a C program to implement a Generic Linked List.
How to declare a structure of a linked list?

Wednesday, December 17, 2008

C, Data structures and algorithm questions

What is the purpose of a function prototype?
Does C support function overloading?
How can I return multiple values from a function?
Does extern in a function declaration mean anything?
How to declare a pointer to a function?
What are the common causes of pointer bugs?
What is an opaque pointer?
Why is sizeof() an operator and not a function?
What is the difference between malloc() and calloc()?
What are near, far and huge pointers?
What operations are valid on pointers? When does one get the Illegal use of pointer in function
Is *(*(p+i)+j) is equivalent to p[i][j]? Is num[i] == i[num] == *(num + i) == *(i + num)?
What do pointers contain?
What is a dangling pointer? What are reference counters with respect to pointers?
What are brk() and sbrk() used for? How are they different from malloc()?
What is a memory leak?
What is the difference between an array of pointers and a pointer to an array?
What do Segmentation fault, access violation, core dump and Bus error mean?
What is a void pointer? Why can't we perform arithmetic on a void * pointer?
What's the difference between const char *p, char * const p and const char * const p?
What does malloc() , calloc(), realloc(), free() do? What are the common problems with malloc()?
Is the cast to malloc() required at all?
Does an array always get converted to a pointer? What is the difference between arr and &arr?
What is a null pointer assignment error?
What is a NULL pointer? How is it different from an unitialized pointer? How is a NULL pointer
What does *p++ do? Does it increment p or the value pointed by p?
How can I sort things that are too large to bring into memory?
Implement the bubble sort algorithm. How can it be improved? Write the code for selection sort,
Give pseudocode for the mergesort algorithm
What is the difference between Merge Sort and Quick sort?

Tuesday, December 16, 2008

More Basic Data structures using C questions

0
Can you construct a tree using postorder and preorder traversal?Write C code for iterative preorder, inorder and postorder tree traversals
Write C code to count the number of leaves in a tree
Write C code to search for a value in a binary search tree (BST).
Write a C program to delete a node from a Binary Search Tree?
Write C code to implement level order traversal of a tree.
Write C code to check if a given binary tree is a binary search tree or not?
Write a C program to create a copy of a tree
Write C code to implement the preorder(), inorder() and postorder() traversals. Whats their time
Write C code to return a pointer to the nth node of an inorder traversal of a BST.
Write a C program to create a mirror copy of a tree (left nodes become right and right nodes
Write a C program to compute the maximum depth in a tree?
Write a C program to find the mininum value in a binary search tree.
Write C code to determine if two trees are identical
Write a C program to delete a tree (i.e, free up its nodes)
Write a C program to determine the number of elements (or size) in a tree.
Write a C program to find the depth or height of a tree.
Write your own trim() or squeeze() function to remove the spaces from a string.
Write a program to print numbers from 1 to 100 without using loops!
How to generate prime numbers? How to generate the next prime after a given prime?
How to add two numbers without using the plus operator?
Write a program to check if the stack grows up or down
Write a program to merge two arrays in sorted order, so that if an integer is in both the arrays, it
Given two strings A and B, how would you find out if the characters in B were a subset of the
How can we sum the digits of a given number in single statement?
Write code to round numbers
Write a program to have the output go two places at once (to the screen and to a file also)
How do you find out if a machine is 32 bit or 64 bit?
Is there a way to multiply matrices in lesser than o(n^3) time complexity?
Write a simple piece of code to split a string at equal intervals

Your Title