• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ deleteList函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中deleteList函数的典型用法代码示例。如果您正苦于以下问题:C++ deleteList函数的具体用法?C++ deleteList怎么用?C++ deleteList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了deleteList函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: while

double *getNewValues(double *x, int n, list *blocks, double *y)
{
    int i=0, j;
    list *node = blocks;
    while(i<n)
    {
        if(node != NULL && checkBoundires(node, i))
        {
            for(j=i;j<=node->blockEndIndex;j++)
                y[j] = node->avg;
            
            i = node->blockEndIndex+1;
            node = node->next;
        }
        else
        {
            y[i] = x[i];
            i++;
        }
    }
    
    
    deleteList(blocks);
    
    return y;
}
开发者ID:Nullification,项目名称:FastIsoReg,代码行数:26,代码来源:isoreg.c


示例2: deleteList

 static void deleteList(ListNode * l)
 {
     if(! l -> next)
         delete l;
     deleteList(l -> next);
     delete l;
 }
开发者ID:afeinland,项目名称:fuzzy-octo-archer,代码行数:7,代码来源:LinkedString.hpp


示例3: main

int main() {
    linknode *flist,*rlist,*find;
    int index; char value;
    rlist=(linknode*)malloc(sizeof(linknode));
    rlist->next=NULL;
    printf("plase input a sting,end with the KEY_Enter \n");
    //flist=CreateListF();
    //printLinkList(flist);
    CreateListR(rlist);
    printLinkList(rlist);
    printf("list length=%d \n",getLength(rlist));
    printf("set insert node:index,value:");
    scanf("%d,%c",&index,&value);
    printf("insert a element!");
    insertList(rlist,value,index);
    printLinkList(rlist);
    printf("list length=%d \n",getLength(rlist));
    printf("set delete node index:");
    scanf("%d",&index);
    deleteList(rlist,index);
    printf("delete a element!");
    printLinkList(rlist);
    printf("list length=%d \n",getLength(rlist));
    printf("set visit node index:");
    scanf("%d",&index);
    find=getNode(rlist,index);
    if(find!=NULL)
    {
        printf("this node value=%c \n",find->data);
    }
    
    return 0;
}
开发者ID:lsr90518,项目名称:LinkNodeByC,代码行数:33,代码来源:LinkNode.c


示例4: IODTFindMatchingEntries

void AppleMacIO::publishBelow( IORegistryEntry * root )
{
    OSCollectionIterator *	kids;
    IORegistryEntry *		next;
    IOService *			nub;

    // infanticide
    kids = IODTFindMatchingEntries( root, kIODTRecursive, deleteList() );
    if( kids) {
	while( (next = (IORegistryEntry *)kids->getNextObject())) {
	    next->detachAll( gIODTPlane);
	}
	kids->release();
    }

    // publish everything below, minus excludeList
    kids = IODTFindMatchingEntries( root, kIODTRecursive | kIODTExclusive,
					excludeList());
    if( kids) {
	while( (next = (IORegistryEntry *)kids->getNextObject())) {

            if( 0 == (nub = createNub( next )))
                continue;

            nub->attach( this );
	    
	    processNub(nub);
	    
            nub->registerService();
        }
	kids->release();
    }
}
开发者ID:OpenDarwin-CVS,项目名称:SEDarwin,代码行数:33,代码来源:AppleMacIO.cpp


示例5: find_specific

//
// tries to make an exit parse var
PARSE_VAR *use_one_parse_token_exit(CHAR_DATA *looker, PARSE_TOKEN *tok, 
				    const char *name) {
  int    type = FOUND_NONE;
  void *found = find_specific(looker, name, "", "", FIND_TYPE_EXIT, tok->scope,
			      tok->all_ok, &type);

  // make sure we found something
  if(found == NULL)
    return NULL;
  else {
    PARSE_VAR *var = newParseVar(PARSE_VAR_EXIT);

    // if multiple vals were possible, flag it
    var->multiple_possible = tok->all_ok;

    // Is it a single exit?
    if(type == FOUND_EXIT)
      var->ptr_val = found;

    // or is it multiple exits?
    else if(type == FOUND_LIST) {
      if(listSize(found) > 1) {
	var->ptr_val = found;
	var->multiple = TRUE;
      }
      else if(listSize(found) == 1) {
	var->ptr_val = listPop(found);
	deleteList(found);
      }
      else {
	deleteList(found);
	deleteParseVar(var);
	var = NULL;
      }
    }

    // We should never reach this case
    else {
      deleteParseVar(var);
      var = NULL;
    }

    // return whatever we found
    return var;
  }
}
开发者ID:KaSt,项目名称:nereamud,代码行数:48,代码来源:parse.c


示例6: deleteList

/***********************************************************************
     * ExchangeWindow
     * init

***********************************************************************/
void fired::ExchangeWindow::init(fired::MapObjectCollector *collector) {
	deleteList(exchange);
	sf::Vector2f winOffset = win->offset;

	for (int i = 0; i < 10; i++)
		for (int j = 0; j < 5; j++)
			exchange.push_back(new fired::InventoryWindowItem(winOffset + sf::Vector2f(380.0f + 35.0f * i, 185.0f + 35.0f * j), &collector->items[i][j], itAny));
}
开发者ID:MORTAL2000,项目名称:fired,代码行数:13,代码来源:win_exchange.cpp


示例7: deleteList

// This destructor destroys a list and frees the associated nodes.
void deleteList(List l)
{
    if (l == 0)
		return;
    List rest = l->nextPtr;
	free(l);
	deleteList(rest);
};
开发者ID:Danghor,项目名称:Algorithms,代码行数:9,代码来源:minsort.c


示例8: deleteList

void deleteList(struct xTEDSQualifierListNode* p)
{
	if(p==NULL) return;
	deleteList(p->next);
	if(p->data!=NULL)
		delete(p->data);
	free(p);
}
开发者ID:NKSG,项目名称:vn-sdm,代码行数:8,代码来源:xTEDSQualifierList.cpp


示例9: deleteList

void deleteList(Node *head)
{
	if(!head)
		return ;

	deleteList(head->next) ;
	free(head) ;
}
开发者ID:GautamSingh2100,项目名称:LinkedList,代码行数:8,代码来源:MergesortOverLinkedList.cpp


示例10: _tmain

int _tmain(int argc, _TCHAR* argv[])
{
	printf("0 - exit\n");
    printf("1 - add value to sorted list\n");
    printf("2 - remove value from list\n");
    printf("3 - print list\n");

	IntList *head = newList(-1);

	while(true)
	{
		printf("Input command:\n");
		int command = 0;
		scanf("%d", &command);
		int val = 0;
		switch (command)
		{
			case 0:
				deleteList(head);
				return 0;
			case 1:
				printf("Input value:\n");
				
				scanf("%d", &val);
				addToSortedList(head, val);
				break;
			case 2:
				printf("Input value:\n");
				
				scanf("%d", &val);
				removeValue(head, val);
				break;
			case 3:
				printList(head);
				break;
		};

	}
	
	deleteList(head);

	scanf("%*s");
	return 0;
}
开发者ID:MrKuznetsov,项目名称:hw-cpp,代码行数:44,代码来源:Task3.cpp


示例11: main

int main()
{
    constexpr unsigned N = 5;
    list listx = nullptr;

    createCircularList(listx,N);
    printList(listx);
    deleteList(listx);
    return 0;
}
开发者ID:franciscomunoz,项目名称:Sedgewick-algorithms-in-C-14--exercises-and-examples,代码行数:10,代码来源:ex_3.27.cpp


示例12: deleteList

/* deletes list */
void deleteList(element head,int is_nodes,int recursivly){
	if(head==NULL){
		return;
	}
	deleteList(head->next,is_nodes,recursivly);
	if (recursivly==1){
		remove_tree(head->node,0,recursivly);
	}
	free(head);
}
开发者ID:guydaich,项目名称:SoftProjGames,代码行数:11,代码来源:minimax.c


示例13: destroyHashTable

void destroyHashTable(hash_t *hashTable) {
   // Free all of the lists
   for (int i = 0; i < hashTable->capacity; i++) {
        if (hashTable->buckets[i] != NULL) {
            deleteList(hashTable->buckets[i]);
        }
   }
   free(hashTable->buckets);
   free(hashTable);
}
开发者ID:zopppo,项目名称:cornedBeef,代码行数:10,代码来源:hash.c


示例14: deleteScriptGenerator

/// Function name  : deleteScriptGenerator
// Description     : Destroys a ScriptGenerator
// 
// SCRIPT_GENERATOR*  &ScriptGenerator   : [in] ScriptGenerator to destroy
// 
VOID  deleteScriptGenerator(SCRIPT_GENERATOR*  &pGenerator)
{
   // Delete Arguments/Variables list
   deleteList(pGenerator->pVariablesList);

   // Delete XML Tree
   if (pGenerator->pXMLTree)
      deleteXMLTree(pGenerator->pXMLTree);

   // Zero Layout
   utilZeroObject(&pGenerator->oLayout, XML_SCRIPT_LAYOUT);

   // Delete INPUT and OUTPUT
   deleteList(pGenerator->pInputList);
   deleteCommandStream(pGenerator->pOutputStream);
   
   // Delete Generator
   utilDeleteObject(pGenerator);
}
开发者ID:nick-crowley,项目名称:X-Studio,代码行数:24,代码来源:Script+Conversion.cpp


示例15: deleteList

List& List::operator =(
		const List& other) {

	if (this != &other) {
		deleteList();
		copyList(other);
	}

	return *this;
}
开发者ID:smurfolan,项目名称:SDP-PCODE-REVIEW,代码行数:10,代码来源:List.cpp


示例16: deleteHashSet

void deleteHashSet(struct HashSet *hashset)
{
	int index;

	for (index = 0; index < hashset->numberBuckets; index++)
		deleteList(hashset->buckets[index]);

	free(hashset->buckets);
	free(hashset);
}
开发者ID:dragosmincu,项目名称:SO_Hashset,代码行数:10,代码来源:hashset.c


示例17: main

void main()

{

	node *head,*tail;

	createList(&head);

	insertAtBeginning(&head,4);

	insertAtBeginning(&head,3);

	insertAtBeginning(&head,2);

	insertAtBeginning(&head,5);

	insertAtBeginning(&head,6);

	insertAtBeginning(&head,10);

	insertAtEnd(&head,1);

    insertInBetween(&head,9,2);

    traverseList(head);

    printf("\n");

    reverseTraversal(head);

    reverseList(&head);

    traverseList(head);

    deleteEnd(&head);

    traverseList(head);

    deleteBeginning(&head);

    traverseList(head);

    deleteAfter(&head,2);

    traverseList(head);

    deleteList(&head);

    traverseList(head);

//	tail= getTail(head);

//	printf("\nTail= %d",tail->info);

}
开发者ID:subhasis207,项目名称:coding_practice,代码行数:55,代码来源:LinkedList.c


示例18: main

int main() {
	int data1,data2,data3,data4,data5;
	int nonData = 6;
	int * pFind = NULL;
	List test = NULL;
	initList(&test);

	data1 = 10;data2 = 20;data3 = 30;data4 = 40;data5 = 50;
	addToList(test, (void*)&data1);
	addToList(test, (void*)&data2);
	addToList(test, (void*)&data3);
	addToList(test, (void*)&data4);
	addToList(test, (void*)&data5);
	displayList(test);

	printf("%s","Searching for 30");
	pFind = (int*)findInList(test, (void*)&data3, intGreater);

	if (pFind)
	{
		printf("%s%d","\nFound data value: ", *pFind);
	}
	else {
		printf("%s","\nData not found");
	}

	printf("%s","\nSearching for 99 (shouldn't be in list)");
	pFind = (int*)findInList(test, (void*)&nonData, intGreater);

	if (pFind)
	{
		printf("%s%d","\nFound data value: ", *pFind);
	}
	else {
		printf("%s","\nData not found");
	}

	printf("%s","\nremoving one item then displaying\n");
	removeFirst(test);
	displayList(test);

	printf("%s","removing all items then displaying\n");
	deleteList(test);
	displayList(test);

	printf("%s","Attempting to remove from an empty list\n");
	removeFirst(test);
	displayList(test);

	cleanupList(&test);

	printf("%s","All tests complete\n");

	return 0;
}
开发者ID:Zonr0,项目名称:asmlist,代码行数:55,代码来源:listdriver.c


示例19: merge

List* merge(List* newList1, List* newList2)
{
	Position head1 = first(newList1);
	Position head2 = first(newList2);
	List* newList = createList();
	while (head1 != NULL && head2 != NULL)
	{
		if (retrieve(head1, newList1) <= retrieve(head2, newList2))
		{
			add(newList, retrieve(head1, newList1));
			head1 = next(head1, newList1);
		}
		else
		{
			add(newList, retrieve(head2, newList2));
			head2 = next(head2, newList2);
		}
	}
	if (head2 == NULL)
		while (head1 != NULL)
		{
			add(newList, retrieve(head1, newList1));
			head1 = next(head1, newList1);
		}
	if (head1 == NULL)
		while (head2 != NULL)
		{
			add(newList, retrieve(head2, newList2));
			head2 = next(head2, newList2);
		}
	deleteList(newList1);
	deleteList(newList2);
	List* newNewList = createList();
	head1 = first(newList);
	while (head1 != NULL)
	{
		add(newNewList, retrieve(head1, newList));
		head1 = next(head1, newList);
	}
	deleteList(newList);
	return newNewList;
}
开发者ID:AidaKadyrova,项目名称:my-homeworks,代码行数:42,代码来源:main.cpp


示例20: deleteHashTable

	void deleteHashTable(HashTable &hashT)
	{
		for (int i = 0; i < hashT.size; ++i)
		{
		//	cout << "deleted list ";
		//	printList(hashT.arr[i]);
		//	cout << "\n";
			deleteList(hashT.arr[i]);
		}
		delete[] hashT.arr;
	}
开发者ID:artbez,项目名称:origin,代码行数:11,代码来源:hashTable.cpp



注:本文中的deleteList函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ deleteNode函数代码示例发布时间:2022-05-30
下一篇:
C++ deleteItem函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap