Skip to content

Instantly share code, notes, and snippets.

@murikadan
murikadan / bst.c
Created August 28, 2012 10:46
Binary Search Tree
#include <stdio.h>
#include <stdlib.h>
struct bst
{
struct bst *left,*right;
int val;
};
struct bst* makenode(int);
@murikadan
murikadan / input
Created August 28, 2012 05:41
To reverse K nodes in a linked list
4
1
2
3
4
5
6
7
8
9
@murikadan
murikadan / sort_strings.c
Created August 26, 2012 09:06
Sorting a namelist implemented as an array of pointers
void sort(char **w,int count)
{
int i,j;
for(i=0;i<count;i++)
for(j=0;j<count-i-1;j++)
if(strcmp(w[j],w[j+1])>0)
{
char *temp=w[j];
w[j]=w[j+1];
w[j+1]=temp;