Keep in mind that there are two ways to deal with the LinkList very easily.1. Using the vector to store every item of the list, then we can use the in...
分类:
其他好文 时间:
2015-04-14 09:48:06
阅读次数:
141
/** * ID: 24 * Name: Swap Nodes in Pairs * Data Structure: Linked List * Time Complexity: * Space Complexity: * Tag: LinkList * Difficult: Medium ...
分类:
其他好文 时间:
2015-04-14 07:10:45
阅读次数:
127
/** * ID: 92 * Name: Reverse Linked List * Data Structure: Linked List * Time Complexity: * Space Complexity: * Tag: LinkList * Difficult: Medium ...
分类:
其他好文 时间:
2015-04-14 07:04:18
阅读次数:
192
#include
#include
using namespace std;
typedef struct
{
int coef; //系数项
int exp; //指数项
}ElemType;
typedef struct Node
{
ElemType data;
struct Node *next;
}LNode,*LinkList;
void InitList(Lin...
分类:
其他好文 时间:
2015-04-13 09:35:43
阅读次数:
141
/** * ID: 2 * Name: Add Two Numbers * Data Structure: Linked List * Time Complexity: * Space Complexity: * Tag: LinkList * Difficult: Medium * Pro...
分类:
其他好文 时间:
2015-04-13 06:54:00
阅读次数:
169
#include
#include
typedef int ElemType;
typedef struct Node
{
ElemType data;
struct Node *next;
}LNode,*LinkList;
void InitList(LinkList &l);
void Create_head(LinkList &l);
void Create_rear(Lin...
分类:
其他好文 时间:
2015-04-12 14:48:41
阅读次数:
168
/** * ID: 61 * Name: Rotate List * Data Structure: Linked List * Time Complexity: * Space Complexity: * Tag: LinkList * Difficult: Medium * Probl...
分类:
其他好文 时间:
2015-04-12 06:40:01
阅读次数:
177
#include
#include
struct LinkList
{
int data;
struct LinkList *next;
};
/*初始化链表*/
void init_list(LinkList **head)
{
*head=(LinkList *)malloc(sizeof(LinkList));
(*head)->next=N...
分类:
编程语言 时间:
2015-04-11 09:03:35
阅读次数:
232
题目:Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space. You...
分类:
其他好文 时间:
2015-04-09 11:56:25
阅读次数:
148
一、不使用额外存储空间的逆序LinkList ReverseLink(LinkList L){ LinkList *next; LinkList *prev = NULL; LinkList *head = L->next; while(head != NULL) { ...
分类:
其他好文 时间:
2015-04-08 14:48:44
阅读次数:
112