您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CreateList函数代码示例

51自学网 2021-06-01 20:14:43
  C++
这篇教程C++ CreateList函数代码示例写得很实用,希望能帮到您。

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

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

示例1: main

int main(int argc, char const *argv[]){	List L1, L2, L3;	Position P;  L1 = CreateList(3);  PrintList(L1);  L2 = CreateList(5);  PrintList(L2);    L3 = CreateList(2);  PrintList(L3);	for (P = L1; P -> next != NULL; P = P -> next);	P -> next = L3;  PrintList(L1); 	for (P = L2; P -> next != NULL; P = P -> next);	P -> next = L3;   PrintList(L2);		printf("%d/n", getIntersectionNode(L1, L2) -> val);	return 0;}
开发者ID:yangmiemie,项目名称:leetcode,代码行数:27,


示例2: main

int main(void){    Sqlist lc,ld,lb,la;    int e,locale,pos,elem;    init_list(&lc);    CreateList(&lc);    print(lc);    printf("Please enter the elem your want to find:/n");    scanf("%d",&e);    locale = location(&lc, e);    printf("the location of elem is %d/n",locale);    printf("Please enter the insert position and the elem:/n");    scanf("%d%d",&pos,&elem);    List_Insert(&lc,pos,elem);    printf("after insert elem ,the Sqlist is:/n");    print(lc);    printf("Please enter the insert position and the elem:/n");    scanf("%d%d",&pos,&elem);    List_Del(&lc,pos,elem);    printf("after delete elem ,the Sqlist is:/n");    print(lc);    init_list(&ld);    init_list(&la);    CreateList(&la);    init_list(&lb);    CreateList(&lb);    Combine(la,lb,&ld);    print(ld);    return 0;}
开发者ID:fairytalefu,项目名称:Datastruct,代码行数:34,


示例3: CreateList

List *Ast::CreateList(const location& loc, ExprContext ctx, AstNode *seq, AstNode *item){	List *tuple = NULL;	if (seq)	{		tuple = dynamic_cast<List*>(seq);        if(!tuple)        {            tuple = CreateList(loc, ctx);            tuple->items.push_back(seq);        }	}	else	{		tuple = CreateList(loc, ctx);	}    if(item)    {        tuple->items.push_back(item);    }    return tuple;}
开发者ID:AndySomogyi,项目名称:cayman,代码行数:25,


示例4: main

int main(){   List L1, L2;   Stack S1, S2;   Position current1, current2;   FILE *fpr, *fpi;   Position current;   int isPalindrome;   L1 = CreateEmptyList();   fpr = fopen("linkedlist1.dat", "r");   if(fpr == NULL)   {      printf("/nFailed to open file!/n");   }   CreateList(fpr, L1);   L2 = CreateEmptyList();   fpi = fopen("linkedlist2.dat", "r");   if(fpi == NULL)   {      printf("/nFailed to open file!/n");      exit(0);   }   CreateList(fpi, L2);   PrintList(L1);   PrintList(L2);   S1 = CreateEmptyStack();   S1 = CreateStackFromList(L1, S1);   S2 = CreateEmptyStack();   S2 = CreateStackFromList(L2, S2);      PrintStack(S1);   PrintStack(S2);   isPalindrome = CheckIsPalindrome(L1, S1);   if(isPalindrome == 0)   {      printf("/nThat list is a Palindrome!/n");   }   else   {      printf("/nThat list is not a Palindrome!/n");   }   isPalindrome = CheckIsPalindrome(L2, S2);   if(isPalindrome == 0)   {      printf("/nThat list is a Palindrome!/n");   }   else   {      printf("/nThat list is not a Palindrome!/n");   }   return 0;}
开发者ID:cwcarithers,项目名称:m653e292-cs680-sp2014-git-clone,代码行数:60,


示例5: main

int main(int argc, char const *argv[]){  List L1, L2, L3;  Position P;  L1 = CreateList(1);  PrintList(L1);  printf("%d/n", hasCycle(L1));  for (P = L1; P -> next != NULL; P = P -> next);  P -> next = L1;  printf("%d/n", hasCycle(L1));  L2 = CreateList(5);  PrintList(L2);  printf("%d/n", hasCycle(L2));  for (P = L2; P -> next != NULL; P = P -> next);  P -> next = L2;  printf("%d/n", hasCycle(L2));  L3 = CreateList(2);  PrintList(L3);  printf("%d/n", hasCycle(L3));  for (P = L3; P -> next != NULL; P = P -> next);  P -> next = L3;  printf("%d/n", hasCycle(L3));  return 0;}
开发者ID:yangmiemie,项目名称:leetcode,代码行数:28,


示例6: main

//------------------------------------------------------------------------------int main(){    auto list = CreateList( std::vector<int>( {1,2,3,4,5} ) );    std::cout << PrintList( list ) << std::endl;    std::cout << PrintBackList( list ) << std::endl;    auto listA = CreateList( std::vector<int>( {1,2,3,} ) );    auto listB = CreateList( std::vector<int>( {4,5} ) );    auto ab = Append( listA, listB );    std::cout << PrintList( ab ) << std::endl;    auto tree = CreateTree( std::vector<int>( {4,2,1,3,5} ) );    std::cout << PrintTree( tree ) << std::endl;    auto treelist = TreeToList( tree );    std::cout << PrintList( treelist ) << std::endl;    TestRandomTree();    return EXIT_SUCCESS;}
开发者ID:zhensydow,项目名称:ljcsandbox,代码行数:26,


示例7: main

int main(int argc, const char *argv[]){  Node* head = CreateList();  int v = 5;  InsertList(head, v);  InsertList(head, v);  InsertList(head, v);  v = 10;  int i = InsertList(head, v, 4);  v = 20;  i = InsertList(head, v, 4);  v = 1;  i = InsertList(head, v);  printf("i:%d/n", i);  PList(head);  printf("/n/n");  PListRecurse(head->next);  printf("/nreserve list:/n");  ReserveList(head);  PList(head);  printf("/n---- reserve list/n");  Node* p = GetNode(head, 1);  if( NULL != p )  {    printf("/n0 node d:%d p:%016lX/n", p->d, reinterpret_cast<uint64_t>(p));  }  Node* head2 = CreateList();  head2->next = p;  printf("/nlist2/n");  PList(head2);  printf("/n");  int retInterSection = CheckUnion(head, head2);  printf("checkunion ret:%d/n", retInterSection);  int ret = CheckCircle(head);  printf("check circle:%d/n", ret);  printf("makecircle /n");  MakeCircle(head);  //PList(head);  retInterSection = CheckUnion(head, head2);  printf("checkunion2 ret:%d/n", retInterSection);  ret = CheckCircle(head);  printf("check circle:%d/n", ret);  i = FindInList(head, 20);  printf("/nfind i:%d/n", i);    return 0;}
开发者ID:ollyblue,项目名称:study,代码行数:56,


示例8: main

int main(){    LNode *la,*lb;    la=CreateList(la,5);    lb=CreateList(lb,6);    Output(la); Output(lb);    lb=DelInsert(la,lb,2,3,3);    Output(lb);    return 0;}
开发者ID:mjyplusone,项目名称:CppPrimer,代码行数:10,


示例9: SumTest

static void SumTest() {	unsigned int number1[] = { 3, 5, 6 };	unsigned int number2[] = { 7, 0, 4, 2, 1 };	IntNode* n1 = CreateList(number1, ARRAY_SIZE(number1));	IntNode* n2 = CreateList(number2, ARRAY_SIZE(number2));	IntNode* sum = Sum(n1, n2);	Asserts::IsTrue(sum != 0);		unsigned int expectedData[] = { 0, 6, 0, 3, 1 };	std::vector<unsigned int> actual = ToVector(sum);	Asserts::AreEqual(expectedData, ARRAY_SIZE(expectedData), actual);}
开发者ID:ppkir,项目名称:InterviewQuestions,代码行数:13,


示例10: CreateList

    void CreateList(NodeT* root,NodeL*head)    { if (root==NULL)              AddLast(head,"*");     else       {      AddLast(head,root->data);     CreateList(root->left,head);     CreateList(root->right,head);       }    }
开发者ID:Alecs94,项目名称:DSA-lab,代码行数:13,


示例11: main

int main(){	ListNode* l1 = NULL;	CreateList(l1,3); // 输入数据,长度为3	ListNode* l2 = NULL;	CreateList(l2,3);	Solution sln;	ListNode* results = NULL;	results = sln.addTwoNumbers(l1,l2);	print(results);    while(1);		return true;}
开发者ID:guker,项目名称:MyLeetcode,代码行数:14,


示例12: CreateList

LIST *txtGoKeyAndInsert(U32 textId, char *key, ...){    va_list argument;    LIST *txtList = CreateList(), *originList = NULL;    NODE *node;    va_start(argument, key);    originList = txtGoKey(textId, key);    for (node = LIST_HEAD(originList); NODE_SUCC(node); node = NODE_SUCC(node)) {	U8 i;	char originLine[256], txtLine[256];	strcpy(originLine, NODE_NAME(node));	strcpy(txtLine, NODE_NAME(node));	for (i = 2; i < strlen(originLine); i++) {	    if (originLine[i - 2] == '%') {		sprintf(txtLine, originLine, va_arg(argument, U32));		i = strlen(originLine) + 1;	    }	}	CreateNode(txtList, 0, txtLine);    }    RemoveList(originList);    return txtList;}
开发者ID:vcosta,项目名称:derclou,代码行数:31,


示例13: TDVASSERT

bool CArticleList::CreateSubsEditorsAllocationsList(int iSubID, const TDVCHAR* pcUnitType, int iNumberOfUnits){	TDVASSERT(pcUnitType != NULL, "CArticleList::CreateSubsEditorsAllocationsList(...) called with NULL pcUnitType");	CTDVString	sUnitType = pcUnitType;	sUnitType.MakeLower();	// if we have an SP then use it, else create a new one	if (m_pSP == NULL)	{		m_pSP = m_InputContext.CreateStoredProcedureObject();	}	// if SP is still NULL then must fail	if (m_pSP == NULL)	{		TDVASSERT(false, "Could not create SP in CArticleList::CreateSubsEditorsAllocationsList");		return false;	}	bool bSuccess = true;	// now proceed with calling the appropriate stored procedure	bSuccess = bSuccess && m_pSP->FetchSubEditorsAllocationsList(iSubID, sUnitType, iNumberOfUnits);	// use the generic helper method to create the actual list	bSuccess = bSuccess && CreateList(100000, 0);	// now set the list type attribute	bSuccess = bSuccess && SetAttribute("ARTICLE-LIST", "TYPE", "SUB-ALLOCATIONS");	bSuccess = bSuccess && SetAttribute("ARTICLE-LIST", "UNIT-TYPE", sUnitType);	// return success value	return bSuccess;}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:30,


示例14: CreateList

voidPlaneListWidget::Prepare(ContainerWindow &parent, const PixelRect &rc){  const DialogLook &look = UIGlobals::GetDialogLook();  CreateList(parent, look, rc, GetRowHeight(look));  UpdateList();}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:7,


示例15: txtInit

/*  public functions - TEXT */void txtInit(char lang){    char txtListPath[DSK_PATH_MAX];    if ((txtBase = TCAllocMem(sizeof(*txtBase), 0))) {	txtBase->tc_Texts = CreateList();	txtBase->tc_Language = lang;	dskBuildPathName(DISK_CHECK_FILE, TEXT_DIRECTORY, TXT_LIST, txtListPath);	if (ReadList(txtBase->tc_Texts, sizeof(struct Text), txtListPath)) {	    U32 i, nr;            nr = GetNrOfNodes(txtBase->tc_Texts);	    for (i=0; i<nr; i++) {		txtLoad(i);	    }	} else {	    ErrorMsg(No_Mem, ERROR_MODULE_TXT, ERR_TXT_READING_LIST);	}    } else {	ErrorMsg(No_Mem, ERROR_MODULE_TXT, ERR_TXT_FAILED_BASE);    }}
开发者ID:vcosta,项目名称:derclou,代码行数:26,


示例16: START_TEST

END_TESTSTART_TEST(test_lifo_enqueue_dequeue_multiple){    static const int count = 100;    struct PD* entry; int i;    struct LL* list = CreateList(L_LIFO);    struct PD* pd[count];    // Allocate and add the process descriptors    for(i = 0; i < count; i++) {        pd[i] = AllocatePD();        pd[i]->pid = i;        EnqueueAtHead(pd[i], list);    }    // Dequeue all process descriptors    for(i = 0; i < count; i++)        ck_assert(DequeueHead(list) == pd[count - i - 1]);    // Cleanup    for(i = 0; i < count; i++)        DestroyPD(pd[i]);    DestroyList(list);}
开发者ID:d-b,项目名称:CSC372,代码行数:25,


示例17: test

void test(){	Solution sol;	ListNode* head = CreateList({ 1,2,3,4 });	ListNode* ret  = sol.rotateRight(head, 0);	PrintList(ret);}
开发者ID:Charlyhash,项目名称:LeetCode,代码行数:7,


示例18: CreateList

voidAirspaceListWidget::Prepare(ContainerWindow &parent, const PixelRect &rc){  const DialogLook &look = UIGlobals::GetDialogLook();  CreateList(parent, look, rc, AirspaceListRenderer::GetHeight(look));  UpdateList();}
开发者ID:robertscottbeattie,项目名称:xcsoardev,代码行数:7,


示例19: main

int main(){	linkedList *list = CreateList();	MainInterface(list);	FreeList(list);	return 0;}
开发者ID:Bananattack,项目名称:uoguelph,代码行数:7,


示例20: Konkat

void Konkat (List L1, List L2, List *L3) {    /* Kamus Lokal */    address P, Pt;    boolean gagal;    /* Algoritma */    CreateList(L3);    gagal = false;    P = First(L1);    while ((P != Nil)&&(!gagal)) {      Pt = Alokasi(Info(P));      if (Pt != Nil) {        InsertLast(L3,Pt);        P = Next(P);      } else {        gagal = true;        DelAll(L3);      }    }    if (!gagal) {      P = First(L2);      while ((P != Nil)&&(!gagal)) {        Pt = Alokasi(Info(P));        if (Pt != Nil) {          InsertLast(L3,Pt);          P = Next(P);        } else {          gagal = true;          DelAll(L3);        }      }    }}
开发者ID:rivasyafri,项目名称:ADT,代码行数:33,


示例21: main

int main() {    char flag;    do {        List* h;        h = (List*)malloc(sizeof(List));        (*h).value = 0;        (*h).next = NULL;                CreateList(h);                int k;        printf("请输入k的值:");        scanf("%d", &k);        fflush(stdin);                int result[2];        Adjmax(h, k, result);        printf("序号%d, data值%d/n", result[0], result[1]);                FreeList(h);        // Finish();                printf("输入N退出,否则继续/n");        scanf("%c", &flag);        fflush(stdin);    } while(flag != 'N' && flag != 'n');}
开发者ID:zhengxiaoyao0716,项目名称:_private_DataExperiment,代码行数:27,


示例22: S

void KeyConfigPrefs::Populate(){   ShuttleGui S(this, eIsCreatingFromPrefs);   AudacityProject *project = GetActiveProject();   if (!project) {      S.StartVerticalLay(true);      {         S.StartStatic(wxEmptyString, true);         {            S.AddTitle(_("Keyboard preferences currently unavailable."));            S.AddTitle(_("Open a new project to modify keyboard shortcuts."));         }         S.EndStatic();      }      S.EndVerticalLay();      return;   }   mManager = project->GetCommandManager();   mManager->GetCategories(mCats);   mCats.Insert(_("All"), 0);   PopulateOrExchange(S);   CreateList();   mCommandSelected = -1;}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:29,


示例23: GenerateJumpsForIf

// TODO: Extract inbuilt function handling into separate classes instead of creating massive if/else-monstrosity here// map<std::string(name), FunctionCodeGenerator(inbuild_type)>// can move arithmetic function transformation from semantic analyzer into generator classvoid CodeGenAstVisitor::Visit(FunctionCallNode *node){  if (node->Name() == FN_IF)  {    GenerateJumpsForIf(node);  }   else if (node->Name() == FN_LIST)  {    CreateList(node);  }  else if (node->Name() == FN_MAP)  {    CreateMapping(node);  }  else if (m_inbuilt_functions.count(node->Name()))  {    m_function->AddByteCode(ByteCode{ m_inbuilt_functions[node->Name()] });  }  else  {    int id = m_functions[node->Name()].FunctionId();    VMObject o;    o.type = VMObjectType::INTEGER;    o.value.integer = id;    m_function->AddByteCode(ByteCode{ Instruction::PUSH, o });    m_function->AddByteCode(ByteCode{ Instruction::CALLFUNCTION });  }}
开发者ID:Valtis,项目名称:ToyLanguage,代码行数:34,


示例24: main

int main( void ){  List *list = CreateList( );  node *n;  int x = 17;  int y = 18;  int z = 19;  InsertFront( list, &x, sizeof( int ) );  InsertFront( list, &y, sizeof( int ) );  InsertFront( list, &z, sizeof( int ) );  // Loop through list. It's important to use ListBegin and ListEnd for proper looping.  // Make note of what pointers Begin and End return.  for(n = ListBegin( list ); n != ListEnd( list ); n = n->next)    printf( "%d/n", NODE_DATA( n, int ) );  // Proper way to delete nodes from list is like so:  // note -- we are not doing n = n->next within the for loop, instead  //         we use the return value of delete  for(n = ListBegin( list ); n != ListEnd( list );)    n = DeleteNode( list, n );  getchar( );  return 0;}
开发者ID:RandyGaul,项目名称:GAM_150_Containers,代码行数:28,


示例25: GetNthNode

LIST *txtGoKey(U32 textId, const char *key){    LIST *txtList = NULL;    struct Text *txt = GetNthNode(txtBase->tc_Texts, textId);    if (txt) {	char *LastMark = NULL;	/* MOD: 08-04-94 hg         * if no key was given take the next one	 * -> last position is temporarily saved in LastMark because	 * txt->LastMark is modified in txtPrepare!	 *	 * Special case: no key, text never used !!	 */	if ((!key) && (txt->txt_LastMark))	    LastMark = txt->txt_LastMark;	txtPrepare(textId);	/* Explanation for +1: LastMark points to the last key	   -> without "+1" the same key would be returned */	if (!key && LastMark)	    txt->txt_LastMark = LastMark + 1;	for (; *txt->txt_LastMark != TXT_CHAR_EOF; txt->txt_LastMark++) {	    if (*txt->txt_LastMark == TXT_CHAR_MARK) {		U8 found = 1;		if (key) {		    char mark[TXT_KEY_LENGTH];		    strcpy(mark, txt->txt_LastMark + 1);		    if (strcmp(key, mark) != 0)			found = 0;		}		if (found) {		    U8 i = 1;		    char *line;		    txtList = CreateList();		    while ((line = txtGetLine(txt, i++)))			CreateNode(txtList, 0, line);		    break;		}	    }	}    }    if (!txtList) {	DebugMsg(ERR_ERROR, ERROR_MODULE_TXT, "NOT FOUND KEY '%s'", key);    }    return txtList;}
开发者ID:vcosta,项目名称:derclou,代码行数:59,


示例26: CreateList

voidOptionStartsWidget::Prepare(ContainerWindow &parent, const PixelRect &rc){  CreateList(parent, UIGlobals::GetDialogLook(),             rc, Layout::GetMaximumControlHeight());  RefreshView();}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:8,


示例27: CreateList

voidWaypointManagerWidget::Prepare(ContainerWindow &parent, const PixelRect &rc){  const DialogLook &look = UIGlobals::GetDialogLook();  CreateList(parent, look, rc,             row_renderer.CalculateLayout(*look.list.font_bold,                                          look.small_font));}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:8,



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


C++ CreateMainWindow函数代码示例
C++ CreateIoCompletionPort函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。