Preview

Doubly Linklist

Good Essays
Open Document
Open Document
555 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Doubly Linklist
#include<stdio.h>
#include<conio.h>
#include<alloc.h>

typedef struct dll
{
int data; struct dll *next; struct dll *prev;
}node;
//struct dll *head=NULL; node *getnode()
{
node *temp; temp=(node *)malloc(sizeof(node)); temp->next=NULL; temp->prev=NULL; return temp;
}

node *creation()
{
node *temp,*new1,*head; int f=1; char c;

do { new1=getnode(); printf("\n\nEnter the data.\n\n"); scanf("%d",&new1->data);

if(f==1) { head=new1; temp=head; f=0; }

else { temp->next=new1; new1->prev=temp; temp=new1; } printf("\n\nDo you want to continue with creation.\n\n"); c=getche(); }while(c=='y'||c=='Y'); return head;
}
void display(node *head)
{
node *temp; temp=head; printf("\n\nThe list is...\n\n"); while(temp!=NULL) { printf("%d\n",temp->data); temp=temp->next; }
}
node *insertion(node *head)
{
node *new1,*temp; int c,value; char ch; do { new1=getnode(); printf("\n\nEnter the data to be insered.\n\n"); scanf("%d",&new1->data); printf("\n\nEnter your place of insertion.\n\n"); printf("\n1.Head.\n2.Intermediate.\n3.Tail.\n"); scanf("%d",&c); switch(c) { case 1: temp=head; new1->next=temp; temp->prev=new1; head=new1; break; case 2: temp=head; printf("\n\nEnter the value after which the insertion has to take place.\n\n"); scanf("%d",&value); while(temp->data!=value) { temp=temp->next; } temp->next->prev=new1; new1->next=temp->next; temp->next=new1; new1->prev=temp; break; case 3: temp=head; while(temp->next!=NULL) { temp=temp->next; } temp->next=new1; new1->next=NULL; new1->prev=temp; break; } printf("\n\nDo you want to continue with insertion.\n\n"); ch=getche(); }while(ch=='y'||ch=='Y'); return

You May Also Find These Documents Helpful

  • Better Essays

    Lit1 Task 1

    • 1519 Words
    • 5 Pages

    * Liability - The liability is shared by all partners. If one partner does something negligent, all partners can be held liable.…

    • 1519 Words
    • 5 Pages
    Better Essays
  • Good Essays

    Hibb’s Web

    • 1391 Words
    • 6 Pages

    The Uvex Corporation was a small family-owned medical center on the southwest coast and as the business becomes flourished, the company restructured the organization for better service for its patients. Since after reorganization, Alex Fuhrman was worked as head the administration of the cancer research and treatment division. Christopher Hibbs, previously worked as a bookkeeper for the city of Sacramento, and currently hired to be an accounting manager for the West Coast division. Frederick Fontaine, the Manager of West Coast, has found a memo on Hibbs’ desk about doubt Alex was the person who cause fund missing since Alex was the director of accounting and finance. The unavailable communication between Alex Fuhrman and Christopher Hibbs caused Alex commence a libel suit against Hibbs and the Corporation. Frederick needed to find a solution before nine o’clock the next morning.…

    • 1391 Words
    • 6 Pages
    Good Essays
  • Good Essays

    LIT1 Task 1

    • 1514 Words
    • 5 Pages

    Liability – There is unlimited liability in a general partnership. The owners/partners are responsible for all profits and losses. If one partner is unable to pay a debt the other partners will be accountable to pay.…

    • 1514 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    cout << num1 << " + " << num2 << " = " << num1+num2;…

    • 426 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Lit 1 Task 1

    • 720 Words
    • 3 Pages

    Income Taxes- Taxes are paid as personal income tax; similar to that of a sole proprietorship, income is split up per their agreement and then taxed accordingly. No federal taxes will be imposed, as this is a pass through entity, only personal income tax will be taken…

    • 720 Words
    • 3 Pages
    Good Essays
  • Better Essays

    LIT1 Task 1

    • 3141 Words
    • 13 Pages

    Sole Proprietorship: This is a type of business is where the business and the owner are one in…

    • 3141 Words
    • 13 Pages
    Better Essays
  • Satisfactory Essays

    List

    • 306 Words
    • 2 Pages

    a renewal purchase order prior to expiration. Your Renewal Purchase Order should reflect an expiration…

    • 306 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    In the piece entitled "Mess", John Hollander uses lists to create a humorous tone through familiarity. One example of how this is done is shown through the description of any person's messy desk. He lists the numerous items that he, himself, could see all around him while composing this piece. Many of the items in his list are easily identifiable by people who work in an office building or at home in their own office. They can look at the example and laugh at how realistic it actually is: constantly moving one mess only to create another, or avoiding it, but finding more and more rubbish. A second example is the list of items found in Tom Sawyer's pocket. There were parts and pieces and fragments of things, along with a kitten with only one eye. The thing that most stuck out to me, however, was the key that would not unlock anything because everyone I've ever known has had one of those. Another good example comes in Hollander's description of the way he sees his cat move around and over the "mess" in his house. He watches his cat carefully stepping across and trying not to disturb the stacks of papers and mountains of books and manuals in his list that have been there for weeks and months. Cats completely ignore the fact that it is a mess, all the while, being so neat about themselves. All of these examples are things that most people see every day in their own home or office or in the home of a close friend or relative. The lists create humor because they are lists of things that we all have and are familiar with. We can all relate to the "mess" in the lists and laugh at ourselves for being that…

    • 301 Words
    • 1 Page
    Good Essays
  • Satisfactory Essays

    Listo System

    • 279 Words
    • 1 Page

    Listo Systems' VISION statement is: "To be recognized as a leader in supplying quality graphic design products and services to our customers and to be respected by our clients and staff.”…

    • 279 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    Lae Task1

    • 892 Words
    • 4 Pages

    Please allow this letter to satisfy the reference letter requirement your agency delegated as a condition of consideration for the adoption application process for Jane Little, the prospective adoptive parent of Kylie. I understand that Jane was advised today that she is not an ideal candidate due to your agency’s traditional preference for children to be placed in dual-parent families. Therefore, I intend to share my personal knowledge and experiences that will assist you in mitigating the common risk factors known to negatively affect children’s behavioral outcomes of whom were raised in single-parent families. Jane and I share a most uncommon connection to one another and it is my belief that the resulting closeness that has continually developed in our relationship during the past decade highly qualifies me to serve as her best reference.…

    • 892 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    The Vocab List

    • 1222 Words
    • 5 Pages

    Cannon-Bard Theory - The counter-proposal that an emotional feeling and an internal physiological response occur at the same time: One is not the cause of the other. Both were believed to be the result of cognitive appraisal of the situation.…

    • 1222 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    Annotated referencelist

    • 550 Words
    • 2 Pages

    Q2. What are some of the most significant contributions to criminology from the Chicago school? Explain and justify your choices by highlighting the current relevance of the contribution to contemporary criminology thought.…

    • 550 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Chapter 2: Data Manipulation Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Copyright © 2012 Pearson Education, Inc. Chapter 2: Data Manipulation • • • • • • 2.1 Computer Architecture 2.2 Machine Language 2.3 Program Execution 2.4 Arithmetic/Logic Instructions 2.5 Communicating with Other Devices 2.6 Other Architectures Copyright © 2012 Pearson Education, Inc. 0-2 1 Computer Architecture • Central Processing Unit (CPU) or processor – Arithmetic/Logic unit versus Control unit – Registers • General purpose • Special purpose • B Bus • Motherboard Copyright © 2012 Pearson Education, Inc. 0-3 Figure 2.1 CPU and main memory connected via a bus…

    • 783 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Annotated Reference List

    • 286 Words
    • 2 Pages

    The first article I read was "Christian Counseling, Interpersonal Neurobiology, and the Future" by Tim Clinton and Gary Sibcy. This article was about creating ground breaking and biblically based strategies based on observation and experiment instead of theory. It discusses the rising field of interpersonal neurobiology. I enjoyed reading this article because it discussed how psychotherapy relates biblically yet connects one 's mind, the body, the brain (including genetics), the environment, and especially the role of close relationships (Clinton & Sibcy, 2012). This was also helpful breaking down each particular subject: mind, body, brain, ect. American Association of Christian Counselors and Liberty University recognizes this article making it scholarly. The author 's credentials are also listed at the end of the article.…

    • 286 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Annotated Reference List

    • 441 Words
    • 2 Pages

    Jogulu, U.D., Wood, G.J. (2006). The Role of Leadership Theory in Raising the Profile of Women in Management. Equal Opportunities International, 25(4), 236-250. doi: http://dx.doi.org/10.1108/02610150610706230…

    • 441 Words
    • 2 Pages
    Satisfactory Essays