首页 > > 详细

C辅导 CS261 HOMEWORK 3调试R、R设计辅导留学生


Introduction
,test()

/ Merge two skip lists, by adding elements of skip list 2 to skip list 1
that are not already contained in skip list 1.
The function is also supposed to remove the entire skip list 2 from the memory.
param: slst1 – pointer to the skip list 1
param: slst2 – pointer to the skip list 2
pre: slst1 and slst2 are not null, and skip list 1 and skip list 2 are not empty
post: slst1 points to the merger skip list, slst2 is null/
void mergeSkipList(struct skipList slst1, struct skipList slst2)
{
struct skipLink Element;
TYPE e;
Element=slst2->topSentinel;
while(Element->down!=NULL)
{
Element=Element->down;
}
while(Element->next!=NULL)
{
e=Element->next->value;
removeSkipList(slst2,e);
addSkipList(slst1,e);
}
/ FIX ME/
} / end of the function /
Requirement
CS261: HOMEWORK 3
Due 05/19/2017 by 12pm
Submit one file via the TEACH website:
General Instructions
In this assignment, you will complete the implementation of a skip list, which consists of singly-linked
lists. The header file skipList.h , the implementation file skipList.c , and makefile are provided to you.
Some functions in the implementation file skipList.c have been completed. The comments for each
function will help you understand what each function should be doing. Complete the remaining functions
in skipList.c . Note that the function that carries the largest number of points is supposed to merge two
skip lists without repeating data elements . You should use the available functions to implement
more complex ones. DO NOT change the provided functions and the header file. If you have any questions
regarding HW3, please email .
Provided Files:
• skipList.h
• skipList.c
Scoring:
1) void test(void); 10pts
2) struct skipLink skipLinkAdd(struct skipLink
current, TYPE e); 10pts
3) void addSkipList(struct skipList
slst, TYPE e);
20pts
4) void printSkipList(struct skipList
slst);
20pts
5) void mergeSkipList(struct skipList
slst1, struct skipList * slst2);
40pts
What to turn in
You will submit the completed file skipList.c . Please use this file-naming convention. Make sure
your code compiles with the provided makefile on the ENGR server. Zero tolerance for compiling errors.
Design a number of test examples to thoroughly check for any errors in your code.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!