<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ta.in.th/index.php?action=history&amp;feed=atom&amp;title=Singly_Linked_List_With_Header</id>
	<title>Singly Linked List With Header - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ta.in.th/index.php?action=history&amp;feed=atom&amp;title=Singly_Linked_List_With_Header"/>
	<link rel="alternate" type="text/html" href="https://wiki.ta.in.th/index.php?title=Singly_Linked_List_With_Header&amp;action=history"/>
	<updated>2026-06-16T22:56:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0-alpha</generator>
	<entry>
		<id>https://wiki.ta.in.th/index.php?title=Singly_Linked_List_With_Header&amp;diff=49&amp;oldid=prev</id>
		<title>Tata: Created page with &quot;Linked List แบบทางเดียว แบบมี header ด้วย (Header node คือ node ที่ไม่เก็บค่าจริงๆ เป็...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.ta.in.th/index.php?title=Singly_Linked_List_With_Header&amp;diff=49&amp;oldid=prev"/>
		<updated>2019-03-07T16:56:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Linked List แบบทางเดียว แบบมี header ด้วย (Header node คือ node ที่ไม่เก็บค่าจริงๆ เป็...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Linked List แบบทางเดียว แบบมี header ด้วย (Header node คือ node ที่ไม่เก็บค่าจริงๆ เป็นตัวเริ่มต้นแค่นั้น)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
typedef int DType;&lt;br /&gt;
typedef struct node{&lt;br /&gt;
    DType data;&lt;br /&gt;
    struct node *next;&lt;br /&gt;
}node;&lt;br /&gt;
&lt;br /&gt;
node* createList(){&lt;br /&gt;
    node *header = (node*)malloc(sizeof(node));&lt;br /&gt;
    header -&amp;gt; next = NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void insert(node *pos, DType val){ // INSERT AFTER pos&lt;br /&gt;
    node *temp = (node*)malloc(sizeof(node));&lt;br /&gt;
    temp-&amp;gt;data = val;&lt;br /&gt;
    temp-&amp;gt;next = pos-&amp;gt;next;&lt;br /&gt;
    pos-&amp;gt;next = temp;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void erase(node *header, DType val){ // ERASE val THAT IS IN linked lists&lt;br /&gt;
    node *temp = header;&lt;br /&gt;
    while(temp-&amp;gt;next != NULL){&lt;br /&gt;
        if(temp-&amp;gt;next-&amp;gt;data == val){&lt;br /&gt;
            node *del = temp-&amp;gt;next;&lt;br /&gt;
            temp-&amp;gt;next = temp-&amp;gt;next-&amp;gt;next;&lt;br /&gt;
            free(del);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(){&lt;br /&gt;
    node *header = createList();&lt;br /&gt;
    insert(header,15);&lt;br /&gt;
    printf(&amp;quot;%d\n&amp;quot;,header-&amp;gt;next-&amp;gt;data);&lt;br /&gt;
    erase(header,15);&lt;br /&gt;
    &lt;br /&gt;
    if(header-&amp;gt;next == NULL) printf(&amp;quot;NULL\n&amp;quot;);&lt;br /&gt;
    else printf(&amp;quot;NOT NULL\n&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    scanf(&amp;quot; &amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tata</name></author>
		
	</entry>
</feed>