struct node
{
int data;
struct node *link;
};
node* CreateNode(int val)
{
node* root = (node*)malloc(sizeof(struct node));
root-data = val;
root-link = NULL;
return root;
}
node* createList(int *arr, int n)
{
node * root =
@Ashish : seems exactly similar to Lucifer code or you modified something
in his code ?? ...
On Tue, Jan 24, 2012 at 2:02 PM, Ashish Goel ashg...@gmail.com wrote:
struct node
{
int data;
struct node *link;
};
node* CreateNode(int val)
{
node* root =
oh, a possible mistake from my side, ignore my mail please...
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Tue, Jan 24, 2012 at 3:08 PM, atul anand atul.87fri...@gmail.com wrote:
@Ashish : seems exactly similar to Lucifer code or you
Steps:
1)Reverse the list ...
2)Now do the swap two nodes... consecutively...
PRAVEEN RAJ
DELHI COLLEGE OF ENGINEERING
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To
I just wrote a code which would work for any given size K.
I tested it with K = 1 till 7.
[ in the question asked above K=2]
Also, tested for corner cases..
If you guys are interested, then have a look at the code..
I have added few helper functions so that you can directly run the
code and use
@above
attaching the file..
--
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/-/YW_phbT3me4J.
To post to this group, send email to algogeeks@googlegroups.com.