Advertisement
sourav8256

Untitled

Sep 6th, 2023 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. ========== Introductory Session =================
  2.  
  3. Primitive Data structure
  4. Int, Float, Char, Double, Pointer
  5. Non primitive data types
  6. Linear(Sequential) - Arrays, lists [Single LL, Double LL, Circular LL],stacks queues
  7. Non Linear(Random) - Trees[Binary, Binary search trees], Graphs
  8.  
  9.  
  10. **** Operations that can be performed in data structure
  11.  
  12. **** Common Operations
  13.  
  14. Searching
  15. Sorting
  16. Insertion
  17. Deletion
  18. Updation
  19.  
  20.  
  21. Arrays
  22.  
  23. Advantages - Similar data type elements, Access elements with index, used to implement stacks and queues
  24.  
  25. Disadvantages - Static Memory Allocation (specify size during compile), Wastes memory, Insertion and Deletion is expensive
  26.  
  27.  
  28.  
  29.  
  30. Session 1 =====================================
  31.  
  32. Linked list
  33.  
  34. // Define the structure for a singly linked list node
  35. struct Node {
  36. int data;
  37. struct Node* next;
  38. };
  39.  
  40.  
  41. struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
  42.  
  43. struct Node {
  44. int data;
  45. struct Node* next;
  46. } *new,*head,*tail; # *new,*head,*tail - another method of directly assigning variables
  47.  
  48. program for linked list
  49.  
  50.  
  51. Session 2 ==============================================
  52.  
  53.  
  54. How to insert elements to linked list
  55.  
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement