i wan to know the code for the radix sort using a queue and a radix sort using a linked list

## All 6 Replies

Where are you stuck?

Where are you stuck?

i dunno how to develope a program that need to use linked list both the single linked list and double linked list which need to enter the list of number using linked list and using radix sort that is developed using linked list

i dunno how to develope a program that need to use linked list both the single linked list and double linked list which need to enter the list of number using linked list and using radix sort that is developed using linked list

Buddy we can't explain everything to you here. For that you have to look into the books. If you have a specific doubt, post here. Definetly someone here will help you out.

Well can you do the "populate a linked list with some data" part of the problem?

There's no point talking about the "sort" side of things until you can do that.

I mean, "here is my linked list code", how do I radix sort it would at least show some effort on your part.

Well can you do the "populate a linked list with some data" part of the problem?
There's no point talking about the "sort" side of things until you can do that.
I mean, "here is my linked list code", how do I radix sort it would at least show some effort on your part.

``````# include <iostream>
using namespace std;
#ifndef DLL_QUEUE
#define DLL_QUEUE
#include <list>
template <class T>
{
public:
{
}
void clear()
{
lst.clear();
}
bool empty() const
{
return lst.empty();
}
T& front()
{
return lst.front();
}
T dequeue()
{
T el = lst.front();
lst.pop_front();
return el;
}
void enqueue(const T& el)
{
lst.push_back(el);
}
private:
list<T> lst;
};
#endif

using namespace std;
class IntSLLNode
{
public:
int info;
IntSLLNode *next;
IntSLLNode (int el, IntSLLNode *ptr = 0)
{
info = el;
next =ptr;
}
};
class IntSLList
{
public:
IntSLList()
{
head = tail = 0;
}
~IntSLList();

int empty()
{
}

int deleteFromTail();
void deleteNode(int);
bool isInList(int) const;
void insertNode(int&);
void print();
int get();

private:
int t;
};
IntSLList::~IntSLList()
{
for(IntSLLNode *p; !empty();)
{
}
}
{
if(tail == 0)
}

{
if(tail!= 0)
{
tail->next = new IntSLLNode(el);
tail = tail->next;
}

else head = tail = new IntSLLNode(el);
}
void IntSLList::deleteNode(int el)
{
if(head == tail && el == head->info)
{
head = tail =0;
}
else if (el == head->info)
{
IntSLLNode *temp = head;
delete temp;
}
else
{
IntSLLNode *pred, *tmp;
for (pred = head, tmp = head->next; tmp!=0 && !(tmp->info == el);
pred = pred->next, tmp = tmp->next);
if (tmp!=0)
{
pred->next = tmp->next;
if(tmp == tail)
tail = pred;
delete tmp;
}
}
}
{
int el = head->info;
IntSLLNode *tmp = head;
head = tail = 0;
delete tmp;
return el;
}

int IntSLList::deleteFromTail()
{
int el = tail->info;
if (head == tail)
{
head = tail = 0;
}
else
{
IntSLLNode *tmp;
for (tmp = head; tmp->next !=tail; tmp = tmp->next)
delete tail;
tail = tmp;
tail->next=0;
}
return el;
}
void IntSLList::print()
{
IntSLLNode *current;

while (current != NULL)
{
cout<< current->info<<"    ";
current = current->next;
}
}
int IntSLList::get()
{
IntSLLNode *current;
IntSLLNode *yy;

yy = current;

cout<<"get";
t = yy->info;
cout<<endl<<t<<" ggggg "<<endl;
yy = yy->next;
cout<<yy->info;
//current->next = NULL;