Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7
DATA STRUCTURE
Circular Linked List
1. What is a Data Structure? A data structure is a way of organizing and storing data in a computer so that it can be accessed and modified efficiently. 6. What is a Stack? A stack is a linear data structure that follows the Last In, First 2. What are the types of Data Structures? Out (LIFO) principle. Linear Data Structures: Arrays, Linked Lists, Stacks, Queues. Non-linear Data Structures: Trees, Graphs. 7. What are common operations on a Stack? Hash-based Structures: Hash Tables, Hash Maps. Push: Add an element. Pop: Remove an element. 3.What is an Array? Peek/Top: View the top element. An array is a collection of elements stored at contiguous memory locations and accessed using indices. 8. What is a Queue? A queue is a linear data structure that follows the First In, First 4. What is a Linked List? Out (FIFO) principle. A linked list is a linear data structure where each element (node) contains a data part and a reference (link) to the next 9.What are the types of Queues? node. Simple Queue Circular Queue 5. What are the types of Linked Lists? Priority Queue Singly Linked List Deque (Double-Ended Queue) Doubly Linked List A hash table is a data structure that stores data in key-value pairs using a hash function. 10. What is a Tree? A tree is a non-linear data structure consisting of nodes 16. What is Collision in Hashing? connected by edges, with a single root node and sub-nodes. Collision occurs when two keys hash to the same index in a hash table. 11. What are Binary Trees? A binary tree is a tree where each node has at most two 17. What are Collision Resolution Techniques? children, called the left child and the right child. Chaining Open Addressing (Linear Probing, Quadratic Probing, Double 12. What is a Binary Search Tree (BST)? Hashing) A BST is a binary tree where each node has a key greater than its left child and less than its right child. 18.What is a Heap? A heap is a special tree-based data structure that satisfies the 13.What is a Graph? heap property, where parent nodes are ordered with respect to A graph is a non-linear data structure consisting of nodes their children. (vertices) connected by edges. 19. What are the types of Heaps? 14.What are the types of Graphs? Min Heap:Parent node is smaller than or equal to its children. Directed Graph (Digraph) Max Heap: Parent node is larger than or equal to its children. Undirected Graph Weighted Graph 20. What is a Priority Queue? A priority queue is an abstract data type where each element 15. What is a Hash Table? has a priority, and elements are served based on priority. A deque (double-ended queue) is a data structure that allows insertion and deletion from both ends. 21. What is Recursion? Recursion is a programming technique where a function calls 27. What is a Sentinel Node? itself directly or indirectly. A sentinel node is a dummy node used at the ends of a data structure to simplify boundary conditions. 22. What is the Time Complexity? Time complexity is a measure of the time an algorithm takes to 28. What is a Self-Balancing Tree? run as a function of the length of the input. A self-balancing tree automatically keeps its height small, ensuring efficient operations. Examples include AVL trees and 23. What is Space Complexity? Red-Black trees Space complexity measures the amount of working storage an algorithm needs. 29. What is an AVL Tree? An AVL tree is a self-balancing binary search tree where the 24. What is a Circular Linked List? difference in heights between the left and right subtrees is at most one. A circular linked list is a linked list where the last node points back to the first node, forming a circle. 30. What is a Red-Black Tree? 25. What is a Doubly Linked List? A red-black tree is a self-balancing binary search tree where nodes have colors (red or black) that help maintain balance. A doubly linked list is a linked list where each node has two links, one to the next node and one to the previous node. 31. What is a Graph Traversal? 26. What is a Deque? Graph traversal refers to visiting all the nodes in a graph 36. What is a Skip List? systematically. Common methods are Depth-First Search A skip list is a data structure that allows fast search within an (DFS) and Breadth-First Search (BFS). ordered sequence of elements by using multiple levels of linked lists.
32. What is Depth-First Search (DFS)?
DFS is a graph traversal technique that explores as far along a branch as possible before backtracking. 37. What is a Trie? A trie is a tree-like data structure used to store dynamic sets of 33. What is Breadth-First Search (BFS)? strings, commonly used for prefix-based searches. BFS is a graph traversal technique that explores all nodes at the present depth before moving on to nodes at the next depth 38. What is Amortized Analysis? level. Amortized analysis is used to find the average time per operation over a sequence of operations, even if some 34. What is a Sparse Matrix? operations are expensive. A sparse matrix is a matrix with a majority of its elements as zero, optimized in storage using techniques like compressed 39. What is a B-Tree? row storage. B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, 35. What is a Circular Queue? and deletions in logarithmic time. A circular queue is a linear data structure in which the last position is connected back to the first position, forming a 40. What is a B+ Tree? circle. B+ tree is an extension of a B-tree where all values are stored at the leaf level, and internal nodes store only keys. 41. What is a Segment Tree? 46. What is Dynamic Programming? A segment tree is a data structure used for storing intervals or Dynamic programming is a method for solving complex segments, allowing efficient querying of ranges. problems by breaking them down into simpler subproblems and storing the results to avoid redundant calculations.
47. What is the difference between BFS and DFS?
42. What is a Suffix Tree? BFS explores level by level, while DFS explores as far as A suffix tree is a compressed trie of all the suffixes of a given possible along each branch before backtracking. text, used for efficient pattern matching. 48.What is Graph Connectivity? 43. What is a Disjoint Set? Graph connectivity refers to the degree to which nodes are A disjoint set, or union-find, is a data structure that keeps track connected. A graph is connected if there's a path between every of a partition of a set into disjoint subsets, supporting union and pair of vertices. find operations. 49. What is Kruskal’s Algorithm? 44.What is a Topological Sort? Kruskal’s algorithm is a minimum spanning tree algorithm that Topological sort is an ordering of vertices in a directed acyclic adds edges in order of increasing weight without forming a graph (DAG) where for each directed edge from vertex A to B, cycle. A comes before B. 50. What is Dijkstra’s Algorithm? 45. What is a Fibonacci Heap? Dijkstra’s algorithm finds the shortest path between nodes in a A Fibonacci heap is a heap data structure consisting of a graph with nonnegative weights. collection of trees that is used to speed up the priority queue operations. 1. What is a data structure? A data structure is a way of organizing and storing data in a A tree is a non-linear data structure consisting of nodes computer so that it can be accessed and modified efficiently. connected by edges, with one root node and sub-nodes forming a hierarchy.
7. What is a binary search tree (BST)?
2. What is an array? A BST is a binary tree where each node has a key greater than An array is a collection of elements stored at contiguous its left child and less than its right child. memory locations and accessed using indices. 8. What is a graph? 3. What is a linked list? A graph is a non-linear data structure consisting of vertices A linked list is a linear data structure where each element (nodes) connected by edges. (node) contains data and a reference (link) to the next node. 9. What is a hash table? 4. What is a stack? A hash table is a data structure that stores data in key-value A stack is a linear data structure that follows the Last In, First pairs using a hash function to compute an index. Out (LIFO) principle. 10.What is a doubly linked list? 5. What is a queue? A doubly linked list is a linked list where each node has two A queue is a linear data structure that follows the First In, First references: one to the next node and one to the previous node. Out (FIFO) principle. 11. What is the difference between a stack and a queue? 6. What is a tree? A stack uses LIFO (Last In, First Out), while a queue uses FIFO (First In, First Out). 12.What is a circular queue? A circular queue is a linear data structure where the last position is connected back to the first position, forming a circle.
13. What is a heap?
A heap is a special tree-based data structure that satisfies the heap property, used primarily in priority queues.
14. What is recursion?
Recursion is a programming technique where a function calls itself to solve smaller instances of a problem.
15.What is the difference between linear and non-linear
data structures? Linear data structures (e.g., arrays, linked lists) have elements arranged in a sequence, while non-linear structures (e.g., trees, graphs) have hierarchical or interconnected relationships.